Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlined functions #3301

Closed
asa-git opened this issue Oct 9, 2015 · 5 comments

Comments

@asa-git
Copy link

commented Oct 9, 2015

Hi all,
I was looking at the article present here: https://medium.com/@c2c/nodejs-a-quick-optimization-advice-7353b820c92e
and with a small modification to reduce the size of the comment in one of the file and to switch the let to var (I'm using node 0.12) I was stumped to see a factor of 4 between the 2 methods under node 0.12 (I assume it would be similar with node 4 ?).

While I understand the issue is greatly exaggerated in the code of this article, I would assume that in the case of a relatively big node based application, there are certainly some part which could benefit from such optimization.

Is this something which we should be aware of or concerned with (didn't see any note regarding such issue in the node documentation) ?
Should we have some kind of minimification (if that's even possible ?) on node application similar to the one for JS running in browsers ?

If this is a non issue please let me know, :) , the result left me kind of speechless.

Best regards

@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Oct 9, 2015

It's controlled by the --max_inlined_source_size= flag, default: 600. The advice from the article is really only relevant to Crankshaft (the "old" optimizing compiler) that's being replaced with TurboFan.

@asa-git

This comment has been minimized.

Copy link
Author

commented Oct 9, 2015

I assume from your answer that node 0.12 and lower are using the CrankShaft based V8, while node 4 use the TurboFan based one then ?

@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Oct 9, 2015

Yes, with the caveat that the transition to TF is not complete yet. It's currently only enabled for asm.js code, unless you pass --turbo.

@asa-git

This comment has been minimized.

Copy link
Author

commented Oct 10, 2015

Ok thanks for the info and the quick reply.
Closing this issue then.

@nmccready

This comment has been minimized.

Copy link

commented Nov 25, 2015

What version of Node or planned version introduced TurboFan (TF)? or even better, when is it the default compiler?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.