Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
tools: refactor js2c.cc to use c++20 #54849
tools: refactor js2c.cc to use c++20 #54849
Changes from 5 commits
de21f61
af4aeac
143b3b4
c302c78
48ca54d
8d7a19f
15a0abc
caacead
93aed49
f39b3dc
fc7b2ef
ce40b60
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this fares well in MSVC - have you checked how long it compiles + runs on Windows? JS2C is a tool that only gets used at build time. So if we make its compile time, say, 100ms slower, so that it runs 10ms faster, then all we get is only the build would be 90ms slower.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: This also uses 3x less memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime memory, or compile time memory? The runtime memory should be negligible already, while MSVC might have a hard time compiling this (sometimes MSVC gets killed during compilation due to OOM).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joyeecheung I removed the constexpr so that it always build the array at runtime. See caacead
This was not really a concern with VS since it won't do automatic consteval in this case.
So now we just reduce by 3x the runtime memory usage which should improve the stability of the builds. (I expect that this reduction in the memory usage is 'free'. The runtime performance should be just as good or better.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am skeptical whether reducing ~66MB memory usage to ~22MB does anything to the build stability - the memory used to compile/link this file could be bigger than 66MB already. Previously the Python version took ~120MB and a second or two to run but that hadn't been a bottleneck either. Anyway as long as it doesn't do too much at compile time to risk the compiler running OOM, it doesn't seem to hurt either.