#NodeJS : A quick optimization advice

#NodeJS : A quick optimization advice

Can you spot the difference between these two files :

that can explain a 50% performance gain :

If you don’t, it’s normal, you try to read the code abstracting the comment ; it was slightly changed :

What the ???

The small changes made the function body of add() growing over 600 character. v8 optimizer (crankshaft) inlines the functions whose body length, including the comments, is less than 600 characters.

The 600 character limit can be tweaked via the max-inlined-source-size of the node command :