#NodeJS : A quick optimization advice
Julien CROUZET
81924

There is a reason for the 600 char limit though.
 It is not like it is a magic gain.

The 600 char limit exists to decide whether a function should be inlined or not. Inline expansion is when the compiler puts the whole function in your cpu’s instruction cache.

The downside of this is that it will take longer to find all other functions.

Do not minify huge code to try and fit it under the limit, do not make the limit larger than necessary; although the time to run that single function will go down, the time to run all functions afterwards will go up.
Instead of calling a function from another function 500000000 times maybe look for a way to refactor your code.

“As a rule of thumb, some inlining will improve speed at very minor cost of space, but excess inlining will hurt speed, due to inlined code consuming too much of the instruction cache, and also cost significant space.”

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.