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

enable compile cache for faster boots #2952

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Oct 18, 2024

Enables compile cache in workerd.

@anonrig anonrig requested review from a team as code owners October 18, 2024 17:30
@anonrig anonrig force-pushed the yagiz/enable-compile-cache branch from 6d285c0 to a60e05d Compare October 18, 2024 17:31
@anonrig anonrig force-pushed the yagiz/enable-compile-cache branch from a60e05d to 4454482 Compare October 18, 2024 20:19
@irvinebroque
Copy link
Collaborator

What's the TLDR of what this does and how much it improves performance?

@anonrig
Copy link
Member Author

anonrig commented Oct 19, 2024

What's the TLDR of what this does and how much it improves performance?

@irvinebroque This particular change enables on-demand compile cache for built-in modules (such as node:buffer, node:url etc.). Simplify, the second import of a built-in module becomes extremely cheap, and hence improves the boot time (due to the less time required to parse and analyze the module). This is particularly different than Node.js, since Node compiles all built-in modules on compile time, which makes the first import extremely cheap. I haven't done any benchmarks yet, but Node.js has seen 56% improvement in boot time by implementing the whole build time caching. (Ref: nodejs/node#24950). We can invest on this and go through a similar path depending on the nodejs_compat flags for example.

PS: V8 has seen 20-40% improvements - https://v8.dev/blog/improved-code-caching.

@anonrig anonrig force-pushed the yagiz/enable-compile-cache branch 2 times, most recently from 40f6257 to 45d5840 Compare October 23, 2024 17:38
@anonrig anonrig requested a review from jasnell October 23, 2024 17:41
@anonrig anonrig force-pushed the yagiz/enable-compile-cache branch from 45d5840 to e3c9f50 Compare October 23, 2024 17:44
@anonrig anonrig merged commit 17f653c into main Oct 23, 2024
13 checks passed
@anonrig anonrig deleted the yagiz/enable-compile-cache branch October 23, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants