Skip to content

enable compile cache for faster boots - #2952

Merged
anonrig merged 1 commit into
mainfrom
yagiz/enable-compile-cache
Oct 23, 2024
Merged

enable compile cache for faster boots#2952
anonrig merged 1 commit into
mainfrom
yagiz/enable-compile-cache

Conversation

@anonrig

@anonrig anonrig commented Oct 18, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

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

@anonrig

anonrig commented Oct 19, 2024

Copy link
Copy Markdown
Contributor Author

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