René's URL Explorer Experiment


Title: src: improve compile cache performance and size by anonrig · Pull Request #63861 · nodejs/node · GitHub

Open Graph Title: src: improve compile cache performance and size by anonrig · Pull Request #63861 · nodejs/node

X Title: src: improve compile cache performance and size by anonrig · Pull Request #63861 · nodejs/node

Description: Improves the on-disk compile cache (NODE_COMPILE_CACHE / module.enableCompileCache()): Read path: read cache files with a single exactly-sized read (using the file size from fstat) instead of an exponentially growing buffer, which previously cost O(log N) syscalls/allocations and ~2N bytes of copying per file. Size: compress the cache content on disk with zstd (level 1, prioritizing speed since persistence happens at shutdown), falling back to raw storage when not compressible. Shrinks cache directories ~2-4x and makes the crc32 integrity check cheaper since it now runs over the compressed bytes. The magic number is bumped so files in the old format are discarded as cache misses and overwritten in place. Consume path: hand the cache to V8 through a non-owning CachedData wrapper (BufferNotOwned) instead of copying the entire buffer on every cache hit. The underlying buffer is owned by the cache entry, which outlives the synchronous compilation (same pattern as the vm cached-data path in node_contextify.cc). Corrupted cache files keep degrading to silent cache misses and are regenerated; a corrupted size header can no longer cause an oversized allocation since the zstd frame content size is cross-checked first. Added test/parallel/test-compile-cache-corrupted.js covering bad magic, truncation, content bit-flips, and header corruption. No public API or documented behavior changes; the file format is private to src/compile_cache.cc. Benchmark numbers (cache size and warm-startup timings) to follow in a comment. This change was developed with AI assistance (see Co-authored-by trailer).

Open Graph Description: Improves the on-disk compile cache (NODE_COMPILE_CACHE / module.enableCompileCache()): Read path: read cache files with a single exactly-sized read (using the file size from fstat) instead of an e...

X Description: Improves the on-disk compile cache (NODE_COMPILE_CACHE / module.enableCompileCache()): Read path: read cache files with a single exactly-sized read (using the file size from fstat) instead of an e...

Opengraph URL: https://github.com/nodejs/node/pull/63861

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8ba3dc2c-7b38-2021-26b9-96df278a305f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD7AE:278CA4:9C7B1A:D2C32E:6A4C49A0
html-safe-nonce01448f2138376a8f0078339b3e4368a5f5964b8d4de4d1433347d2a45fb5b94c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0FFOjI3OENBNDo5QzdCMUE6RDJDMzJFOjZBNEM0OUEwIiwidmlzaXRvcl9pZCI6Ijg1ODgyMzM4NTk3NDg2MTI1MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca505ba58a3b2a29d3d809a0387a290f51a4665fe28b02d3290040e641d6cdbae
hovercard-subject-tagpull_request:3850703620
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/63861/files
twitter:imagehttps://avatars.githubusercontent.com/u/1935246?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1935246?s=400&v=4
og:image:altImproves the on-disk compile cache (NODE_COMPILE_CACHE / module.enableCompileCache()): Read path: read cache files with a single exactly-sized read (using the file size from fstat) instead of an e...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3996b3b83990e134be6c099ab9a7f48f140ae80f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/63861/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F63861%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F63861%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/63861/files
Reloadhttps://github.com/nodejs/node/pull/63861/files
Reloadhttps://github.com/nodejs/node/pull/63861/files
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 967 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
anonrighttps://github.com/anonrig
nodejs:mainhttps://github.com/nodejs/node/tree/main
anonrig:compile-cache-perfhttps://github.com/anonrig/node/tree/compile-cache-perf
Conversation 10 https://github.com/nodejs/node/pull/63861
Commits 3 https://github.com/nodejs/node/pull/63861/commits
Checks 30 https://github.com/nodejs/node/pull/63861/checks
Files changed https://github.com/nodejs/node/pull/63861/files
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
src: improve compile cache performance and size https://github.com/nodejs/node/pull/63861/files#top
Show all changes 3 commits https://github.com/nodejs/node/pull/63861/files
fb86fb9 src: improve compile cache performance and size anonrig Jun 11, 2026 https://github.com/nodejs/node/pull/63861/commits/fb86fb925aa70e9cdb62727cd049d220ce7af8d0
f427fb3 src: reuse zstd contexts in compile cache anonrig Jun 11, 2026 https://github.com/nodejs/node/pull/63861/commits/f427fb358c8fc9568ab1daa4314f130804ccdecc
a6273b1 src: embed zstd dictionary for further compile cache size wins lemire Jun 12, 2026 https://github.com/nodejs/node/pull/63861/commits/a6273b1f4a46d5c8150978a342b25e02150f516a
Clear filters https://github.com/nodejs/node/pull/63861/files
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
compile-cache-timing.js https://github.com/nodejs/node/pull/63861/files#diff-ef8d9f416bfec7d25e05480f08830069db8d5c27601b44f2dc8f9e74a65c3c9d
node.gyp https://github.com/nodejs/node/pull/63861/files#diff-9f1d0716c75f4df39d9e88499ac205b50301c0c672b816ce54d5339be4c2238c
compile_cache.cc https://github.com/nodejs/node/pull/63861/files#diff-774bfbe806c939d2ad318fe5ebbdaf1a7c05ebfa38f240771fd81e0d937bd73f
compile_cache.h https://github.com/nodejs/node/pull/63861/files#diff-d1d0c125eee1885277d57d31a39d2b8d88e760030944573a53f6882431e13012
compile_cache_zstd.dict https://github.com/nodejs/node/pull/63861/files#diff-7cf8220aaaa420806d0f08282c96d20a194d14a31c0b292f5e64e0dd17a226e9
module_wrap.cc https://github.com/nodejs/node/pull/63861/files#diff-ea501528b0419a0e268dba0a111869879926d671b7e4240a7f8177e9eb384a4b
node_contextify.cc https://github.com/nodejs/node/pull/63861/files#diff-d194c6f9fca3e3c031ecc5b7bd91a53c8881641cd4d1df1ff169312971955c50
test-compile-cache-corrupted.js https://github.com/nodejs/node/pull/63861/files#diff-ae61d22f8851d56de41bdd4bc213a999d1406bde36db4447957f45acaa3afe78
test-compile-cache-success.js https://github.com/nodejs/node/pull/63861/files#diff-be24ada268a1b8a16891bb6ff15f90bd428d483b330d5b6f9594bab35f91808a
generate_compile_cache_dict.py https://github.com/nodejs/node/pull/63861/files#diff-d3245682517a16c5acca11824ba94efb9bdc0a6a74f6fe404b093d7bfcea8f90
benchmark/misc/compile-cache-timing.jshttps://github.com/nodejs/node/pull/63861/files#diff-ef8d9f416bfec7d25e05480f08830069db8d5c27601b44f2dc8f9e74a65c3c9d
View file https://github.com/nodejs/node/blob/a6273b1f4a46d5c8150978a342b25e02150f516a/benchmark/misc/compile-cache-timing.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/63861/{{ revealButtonHref }}
node.gyphttps://github.com/nodejs/node/pull/63861/files#diff-9f1d0716c75f4df39d9e88499ac205b50301c0c672b816ce54d5339be4c2238c
View file https://github.com/nodejs/node/blob/a6273b1f4a46d5c8150978a342b25e02150f516a/node.gyp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/63861/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/63861/files#diff-9f1d0716c75f4df39d9e88499ac205b50301c0c672b816ce54d5339be4c2238c
https://github.com/nodejs/node/pull/63861/files#diff-9f1d0716c75f4df39d9e88499ac205b50301c0c672b816ce54d5339be4c2238c
https://github.com/nodejs/node/pull/63861/files#diff-9f1d0716c75f4df39d9e88499ac205b50301c0c672b816ce54d5339be4c2238c
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
Please reload this pagehttps://github.com/nodejs/node/pull/63861/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.