Is there a way to avoid call overhead?

258 points kdy1997

Hi, I'm the author or swc. (https://swc.rs)

I'm trying to improve the performance of the minifier, and I found that the call overhead is using an enormous amount of time. I'm using a visitor pattern, so there are lots of calls. I want to reduce these calls, but AFAIK, rust does not support goto. Is there a way I can optimize this?

​

The screenshot is an inverted call stack trace.

​

https://preview.redd.it/vw9s09of95n91.png?width=2370&format=png&auto=webp&s=070330a0902bcd14809400f6ae73546b3f11a227