René's URL Explorer Experiment


Title: lib: reduce startup time by BridgeAR · Pull Request #20567 · nodejs/node · GitHub

Open Graph Title: lib: reduce startup time by BridgeAR · Pull Request #20567 · nodejs/node

X Title: lib: reduce startup time by BridgeAR · Pull Request #20567 · nodejs/node

Description: This reduces the overall startup time by > 10 % on my local machine (comparing 100 runs) by lazy loading a couple modules. At the same time it also reduces the memory usage: node-cp$ out/Release/node -e 'console.log(process.memoryUsage())' { rss: 38727680, heapTotal: 6086656, heapUsed: 3687208, external: 8264 } node-cp$ node -e 'console.log(process.memoryUsage())' { rss: 24526848, heapTotal: 6610944, heapUsed: 4465864, external: 8672 } In the bootstrap phase our code is not optimized by the compiler and each file extra takes a while. We load a total of 96 NativeModules and Bindings when just executing node -e 'console.log(process.moduleLoadList.length)'. With this patch that is reduced to 73! There might still be a few more modules that could be removed but it is becoming more tricky now. I tried to use a very minimal invasive approach to actually only lazy load where it made sense. If a module would be necessary one way or the other, I did not rewrite that. Ping @joyeecheung @hashseed @mcollina I wonder if it is possible to reduce the streams files a bit further. Checklist make -j4 test (UNIX), or vcbuild test (Windows) passes tests and/or benchmarks are included documentation is changed or added commit message follows commit guidelines

Open Graph Description: This reduces the overall startup time by > 10 % on my local machine (comparing 100 runs) by lazy loading a couple modules. At the same time it also reduces the memory usage: node-cp$ out/Release...

X Description: This reduces the overall startup time by > 10 % on my local machine (comparing 100 runs) by lazy loading a couple modules. At the same time it also reduces the memory usage: node-cp$ out/Rel...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:68aca95d-1097-5392-8f5c-3a14da4e5b4e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD0F8:20AE69:222FC91:2D66D95:6992E041
html-safe-nonce297555dd330ff09dac77030e8407d625da4fcaa632a81046295aaac8daf2e6c4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEY4OjIwQUU2OToyMjJGQzkxOjJENjZEOTU6Njk5MkUwNDEiLCJ2aXNpdG9yX2lkIjoiMTA5MTMzNDIzNTE1Mzk0ODczOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac13a02297188f34f3abb52b8297ebacff8abbb7f58f8694098b4f1852ff677151
hovercard-subject-tagpull_request:186251286
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
twitter:imagehttps://avatars.githubusercontent.com/u/8822573?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8822573?s=400&v=4
og:image:altThis reduces the overall startup time by > 10 % on my local machine (comparing 100 runs) by lazy loading a couple modules. At the same time it also reduces the memory usage: node-cp$ out/Release...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84dcb133269e3cfe6e0296cc85fbacb92cae92bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F20567%2Fcommits%2F9168e1502ff08917822fb4e730a6f2bfdbbb1644
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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%2F20567%2Fcommits%2F9168e1502ff08917822fb4e730a6f2bfdbbb1644
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%2Fcommits&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Reloadhttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Reloadhttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 34.8k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 116k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.7k https://github.com/nodejs/node/issues
Pull requests 716 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects 3 https://github.com/nodejs/node/projects
Security 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 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
BridgeARhttps://github.com/BridgeAR
nodejs:masterhttps://github.com/nodejs/node/tree/master
BridgeAR:reduce-startup-time2https://github.com/BridgeAR/node/tree/reduce-startup-time2
Conversation 39 https://github.com/nodejs/node/pull/20567
Commits 20 https://github.com/nodejs/node/pull/20567/commits
Checks 0 https://github.com/nodejs/node/pull/20567/checks
Files changed https://github.com/nodejs/node/pull/20567/files
Please reload this pagehttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
lib: reduce startup time https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644#top
Show all changes 20 commits https://github.com/nodejs/node/pull/20567/files
35cc355 string_decoder: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/35cc3550ea5e4d03806b3317264a2b45534ae568
d480b63 querystring: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/d480b632f9bc4b004f69c530bf6cf47a92b2c004
5c144fa readline: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/5c144fabf64327c6d5ccd21b0d4f0df0c489d7b8
a18174b os: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/a18174b123f35d5a1b7eaa1fcc30519c8a12881e
02c3b4b dns: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/02c3b4b154e053a262e6fc16083c76089930293c
9168e15 bootstrap: only load inspector stuff if necessary BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
1dfa4ec esm: lazy load necessary loaders BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/1dfa4ec6b04a834de2431cca8023e0c53adefca2
246ab38 cluster: remove obsolete array allocation BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/246ab388814df5a2e046d2703530ee52e2c48c30
e8ae9a4 trace_events: lazy loaded BridgeAR May 6, 2018 https://github.com/nodejs/node/pull/20567/commits/e8ae9a4fa9683919b2a1e1ab03afff1db7121937
ce21afd lib: use capital letters in comments BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/ce21afdda47dda04d6840835c3718c2f5b60fbc6
a093ed3 bootstrap: remove unnecessary require BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/a093ed32adf24e8bba127d15b878cf3df22caf35
4733c2a tools: stricter eslint rule for globals BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/4733c2ae632b4239803cefe827406080a1c4026d
e0080ce assert,util: lazy load comparison functions BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/e0080ce2ac48226ac58b84b9fa79635791a0ed9b
bd96a9d async_hook: lazy loading for startup performance BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/bd96a9d5f333e06b0834d241ff6a25f2e06bb0ec
d31581f bootstrap: do not call performance hooks BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/d31581f61d0952066be406031889d4a6f0cd0c94
0093e0d stream: lazy load ReadableAsyncIterator BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/0093e0d173a4e795aa8a5ef6151d7db078a0b744
0b31adc console: lazy load cli BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/0b31adca20ade1801825b03aa782cf2458705b69
5c3a245 stream: lazy load end-of-stream BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/5c3a245603e8f4de7dea33bdb8d4d70faac6d736
b0bbbba net: lazy load dns BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/b0bbbba97e558fc92b0dc229be03dddd9b544a8c
3ca0b58 test: add loaded modules test BridgeAR May 7, 2018 https://github.com/nodejs/node/pull/20567/commits/3ca0b58759baa4bb2a25e76111fe75781f122373
Clear filters https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Please reload this pagehttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Please reload this pagehttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
Prev https://github.com/nodejs/node/pull/20567/commits/02c3b4b154e053a262e6fc16083c76089930293c
Next https://github.com/nodejs/node/pull/20567/commits/1dfa4ec6b04a834de2431cca8023e0c53adefca2
Please reload this pagehttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644
https://github.com/BridgeAR
BridgeARhttps://github.com/nodejs/node/commits?author=BridgeAR
lib/internal/bootstrap/node.jshttps://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644#diff-5dc112d202934c998db1f82432ccc091f1e588027b8f688cc50e1d7f46007df1
View file https://github.com/BridgeAR/node/blob/9168e1502ff08917822fb4e730a6f2bfdbbb1644/lib/internal/bootstrap/node.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/20567/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644#diff-5dc112d202934c998db1f82432ccc091f1e588027b8f688cc50e1d7f46007df1
https://github.com/nodejs/node/pull/20567/commits/9168e1502ff08917822fb4e730a6f2bfdbbb1644#diff-5dc112d202934c998db1f82432ccc091f1e588027b8f688cc50e1d7f46007df1
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.