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

Feature request: add support for the Google Closure Compiler #10450

Closed
CapacitorSet opened this issue Dec 25, 2016 · 4 comments
Closed

Feature request: add support for the Google Closure Compiler #10450

CapacitorSet opened this issue Dec 25, 2016 · 4 comments
Labels
feature request Issues that request new features to be added to Node.js. lib / src Issues and PRs related to general changes in the lib or src directory.

Comments

@CapacitorSet
Copy link

When used with -O=ADVANCED, the Google Closure Compiler can apply known optimizations to the code to improve performance. It seems that some performance fixes are as simple as inlining a function (eg. #5127), and the Closure Compiler could automate these with a build step.

Thoughts?

@mscdex mscdex added feature request Issues that request new features to be added to Node.js. lib / src Issues and PRs related to general changes in the lib or src directory. labels Dec 25, 2016
@mscdex
Copy link
Contributor

mscdex commented Dec 25, 2016

The problem with this is that you end up with unreadable and possibly incorrect output (if dead code elimination made bad assumptions). At the very least this would affect stack traces.

@CapacitorSet
Copy link
Author

The problem of lack of readability would be fixed by using source maps, which however aren't supported in Node.js (I couldn't find why, though); the problem of incorrect output relies on the solidity of the Closure Compiler, the correctness of manual type hints, and having complete coverage in regression tests.

@gibfahn
Copy link
Member

gibfahn commented Dec 28, 2016

Assuming we're talking about running the Closure Compiler on the JavaScript code in Node core, what would the upside be to automating things? It should be pretty easy to run the compiler against Node, see what optimisations it suggests, and then open PRs to add them to Node. That way we can make sure we trust the proposed optimisations (and not have to rerun the compiler all the time).

@addaleax
Copy link
Member

I’m going to close this as question that was answered by the last comment … if you feel there’s more to be done here, opening a PR that adds support for this might be the best idea. Feel free to reopen or ask follow-up questions, if you have any. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

No branches or pull requests

4 participants