René's URL Explorer Experiment


Title: Investigating a Severe Performance Regression in Node.js v22 and v24 · Issue #60719 · nodejs/node · GitHub

Open Graph Title: Investigating a Severe Performance Regression in Node.js v22 and v24 · Issue #60719 · nodejs/node

X Title: Investigating a Severe Performance Regression in Node.js v22 and v24 · Issue #60719 · nodejs/node

Description: Investigating a Severe Performance Regression in Node.js v22 and v24 Hello everyone, We (@forwardemail) have been running some benchmarks with better-sqlite3-multiple-ciphers and came across what appears to be a significant performance r...

Open Graph Description: Investigating a Severe Performance Regression in Node.js v22 and v24 Hello everyone, We (@forwardemail) have been running some benchmarks with better-sqlite3-multiple-ciphers and came across what a...

X Description: Investigating a Severe Performance Regression in Node.js v22 and v24 Hello everyone, We (@forwardemail) have been running some benchmarks with better-sqlite3-multiple-ciphers and came across what a...

Opengraph URL: https://github.com/nodejs/node/issues/60719

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Investigating a Severe Performance Regression in Node.js v22 and v24","articleBody":"# Investigating a Severe Performance Regression in Node.js v22 and v24\n\nHello everyone,\n\nWe (@forwardemail) have been running some benchmarks with `better-sqlite3-multiple-ciphers` and came across what appears to be a significant performance regression in newer Node.js versions. I wanted to share my findings in case they are helpful to the community, especially for those who rely on native modules with SQLite.  We use encrypted SQLite databases for storing folks email, see our write-up at \u003chttps://forwardemail.net/en/blog/docs/best-quantum-safe-encrypted-email-service\u003e.\n\n## Summary of Findings\n\nMy benchmarks indicate that Node.js v24 is approximately **57% slower** than v20 for SQLite SELECT operations, while Node.js v22 shows a smaller regression of about 7-9%. These findings suggest the performance issue may not be specific to `better-sqlite3` but could be related to a broader change in the V8 engine that affects native modules.\n\n## Benchmark Results\n\nI've created a benchmark suite to reproduce these results, which you can find here: https://github.com/forwardemail/sqlite-benchmarks\n\nHere is a summary of the results I observed with `better-sqlite3-multiple-ciphers`:\n\n| Node.js Version | SELECT ops/sec | vs v20 LTS |\n|---|---|---|\n| v20.19.5 (LTS)  | 18,383         | baseline   |\n| v22.21.1        | ~17,000        | -7%        |\n| v24.11.1        | ~7,900         | **-57%**   |\n\nAs the table shows, the performance on v24 is less than half of that on v20 for this specific database workload.\n\n## Potential Root Cause\n\nAfter some investigation, I believe this regression may be linked to the **V8 13.6 engine upgrade** in Node.js v24. The V8 versions for each Node.js release are as follows:\n\n*   **Node.js v20**: V8 11.3 (Stable Performance)\n*   **Node.js v22**: V8 12.4 (Minor Regression)\n*   **Node.js v24**: V8 13.6 (Major Regression)\n\nThe most significant change in V8 13.6 appears to be the move to a **V8-owned CppHeap** ([nodejs/node#52718](https://github.com/nodejs/node/issues/52718)), which alters how C++ objects are managed and garbage collected in native modules. While this change was intended to simplify the API, it seems to have had an unintended impact on the performance of native modules that frequently cross the JS/C++ boundary.\n\n### How This Might Affect SQLite Performance\n\nThe performance-critical paths in `better-sqlite3` involve frequent C++ object allocation, heavy interaction between JS and C++, and string conversions. The new V8-owned CppHeap may have introduced different garbage collection timing, allocation patterns, or boundary-crossing overhead that could be contributing to this slowdown.\n\n## Related Upstream Issues\n\nThis issue may be part of a broader pattern of performance regressions in recent Node.js versions:\n\n1.  **Startup regression**: [nodejs/performance#180](https://github.com/nodejs/performance/issues/180)\n2.  **Module loading regression**: [nodejs/node#60397](https://github.com/nodejs/node/issues/60397)\n3.  **CppHeap deprecation**: [nodejs/node#52718](https://github.com/nodejs/node/issues/52718)\n\nThese issues suggest that V8 11.3 (in Node.js v20) may have been a more optimized version for native module performance.\n\n## Suggestions for a Path Forward\n\nI've put together some thoughts on how we might be able to approach this. I'm happy to help with any of these steps.\n\n### For Users Experiencing This Issue\n\nFor those affected by this performance regression, a possible short-term workaround could be to remain on **Node.js v20 LTS**. It appears to be the most stable and performant version for this workload and is supported until April 2026.\n\n### Potential Areas for Investigation\n\nIt seems the performance degradation might be linked to the CppHeap changes in V8. It could be beneficial for the V8 and Node.js teams to investigate this further. Some areas that might be worth exploring include:\n\n*   **Benchmarking the CppHeap regression**: A performance comparison of native modules before and after the CppHeap changes could help confirm the impact.\n*   **Profiling hot paths**: It might be useful to profile the following areas:\n    *   Object allocation in the V8-owned CppHeap\n    *   Garbage collection behavior for frequently created C++ objects\n    *   Overhead from JS/C++ boundary crossings\n    *   String encoding/decoding with `WriteUtf8V2()`\n\n### Possible Long-Term Solutions\n\nIf the regression in V8 cannot be addressed upstream, it might be necessary for native modules like `better-sqlite3` to adapt. Some potential strategies could include:\n\n*   **Object pooling**: Reusing statement objects to reduce allocation overhead.\n*   **Batch operations**: Processing multiple rows at once to minimize boundary crossings.\n*   **Optimized string handling**: Caching string conversions or exploring alternative V8 APIs.\n*   **Manual memory management**: Taking more explicit control over the object lifecycle to mitigate GC issues.\n\nHowever, it seems that addressing this at the V8 level would be the most effective solution, as it would benefit all native modules.\n\n## Reproduction\n\nTo reproduce the benchmark results, you can clone the repository and run the tests:\n\n```bash\ngit clone https://github.com/forwardemail/sqlite-benchmarks.git\ncd sqlite-benchmarks\nnpm install\n\n# Test with different Node.js versions\nnvm use 20 \u0026\u0026 npm run benchmark\nnvm use 22 \u0026\u0026 npm run benchmark\nnvm use 24 \u0026\u0026 npm run benchmark\n```\n\nThe results have been consistent on both macOS ARM and Linux x64.\n\n## Questions for the Community\n\n1.  Has anyone else encountered similar performance issues with v24?\n2.  Are there any V8 flags or Node.js options that might help mitigate this?\n3.  Would it be appropriate to escalate this to the V8 team for their input?\n\nI am more than willing to assist with further profiling, testing, or providing any additional information that might be helpful. Thank you for your time and consideration.\n","author":{"url":"https://github.com/titanism","@type":"Person","name":"titanism"},"datePublished":"2025-11-14T18:54:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/60719/node/issues/60719"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:971c915a-39c5-e09f-1e1e-1c0c7356eed2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9F48:312190:E5B841:1444425:6A4CAD40
html-safe-nonce7ea55f6c1664fa852c318aca058182ebb95ff6fa2e45b37aa92f51daa42506a6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjQ4OjMxMjE5MDpFNUI4NDE6MTQ0NDQyNTo2QTRDQUQ0MCIsInZpc2l0b3JfaWQiOiI2NTI5MjM0OTk5MTMxODExMTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac7ce4e932de818236ec088739d0ab24c1f4f952e1771ac4f6b086754f1eb342f7
hovercard-subject-tagissue:3626780073
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/60719/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ccb5e037e718d9e1f9d78e3182bbd3f118f06907058f6e8b1fd00fdc2613841d/nodejs/node/issues/60719
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ccb5e037e718d9e1f9d78e3182bbd3f118f06907058f6e8b1fd00fdc2613841d/nodejs/node/issues/60719
og:image:altInvestigating a Severe Performance Regression in Node.js v22 and v24 Hello everyone, We (@forwardemail) have been running some benchmarks with better-sqlite3-multiple-ciphers and came across what a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametitanism
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseae90d426644ca15e89bacceb72e51f4e9dbf85f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/issues/60719#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F60719
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%2Fissues%2F60719
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/60719
Reloadhttps://github.com/nodejs/node/issues/60719
Reloadhttps://github.com/nodejs/node/issues/60719
Please reload this pagehttps://github.com/nodejs/node/issues/60719
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/issues/60719
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 964 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
Investigating a Severe Performance Regression in Node.js v22 and v24https://github.com/nodejs/node/issues/60719#top
performanceIssues and PRs related to the performance of Node.js.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22performance%22
https://github.com/titanism
titanismhttps://github.com/titanism
on Nov 14, 2025https://github.com/nodejs/node/issues/60719#issue-3626780073
@forwardemailhttps://github.com/forwardemail
https://forwardemail.net/en/blog/docs/best-quantum-safe-encrypted-email-servicehttps://forwardemail.net/en/blog/docs/best-quantum-safe-encrypted-email-service
https://github.com/forwardemail/sqlite-benchmarkshttps://github.com/forwardemail/sqlite-benchmarks
nodejs/node#52718https://github.com/nodejs/node/issues/52718
nodejs/performance#180https://github.com/nodejs/performance/issues/180
nodejs/node#60397https://github.com/nodejs/node/issues/60397
nodejs/node#52718https://github.com/nodejs/node/issues/52718
performanceIssues and PRs related to the performance of Node.js.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22performance%22
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.