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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Oct 18, 2024

Enables compile cache in workerd.

@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.

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