GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bootstrap: lazy load non-essential modules by joyeecheung · Pull Request #45659 · nodejs/node

Conversation

@joyeecheung

@joyeecheung joyeecheung commented Nov 28, 2022

Copy link
Copy Markdown
Member

benchmark: make benchmarks runnable in older versions of Node.js

In addition make it runnable with --no-browser-globals

bootstrap: lazy load non-essential modules

It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnb, GeoffreyBooth, anonrig, bricss, JakobJingleheimer, matheuss, styfle, krk, worstpractice, and Kifzy reacted with hooray emoji
All reactions
  • 🎉 10 reactions
@nodejs-github-bot

nodejs-github-bot commented Nov 28, 2022

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules
  • @nodejs/net
  • @nodejs/startup
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Nov 28, 2022
@joyeecheung

joyeecheung commented Nov 28, 2022 •
edited by aduh95
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1241/

Results
                                                                                  confidence improvement accuracy (*)   (**)  (***)
misc/startup.js mode='process' script='benchmark/fixtures/require-builtins' dur=1        ***     -4.80 %       ±2.32% ±3.10% ±4.05%
misc/startup.js mode='process' script='benchmark/fixtures/require-cachable' dur=1        ***     -9.93 %       ±2.27% ±3.01% ±3.93%
misc/startup.js mode='process' script='test/fixtures/semicolon' dur=1                    ***     16.66 %       ±1.78% ±2.37% ±3.09%
misc/startup.js mode='worker' script='benchmark/fixtures/require-builtins' dur=1         ***     11.31 %       ±4.03% ±5.38% ±7.04%
misc/startup.js mode='worker' script='benchmark/fixtures/require-cachable' dur=1         ***      6.71 %       ±2.01% ±2.68% ±3.49%
misc/startup.js mode='worker' script='test/fixtures/semicolon' dur=1                     ***     36.80 %       ±2.69% ±3.59% ±4.69%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 6 comparisons, you can thus
expect the following amount of false-positive results:
  0.30 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.06 false positives, when considering a   1% risk acceptance (**, ***),
  0.01 false positives, when considering a 0.1% risk acceptance (***)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung commented Nov 28, 2022
View reviewed changes
Comment thread lib/internal/fs/promises.js

const {
newReadableStreamFromStreamBase,
} = require('internal/webstreams/adapters');

@joyeecheung joyeecheung Nov 28, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The internal require() is actually just one map load (to see if the module is already loaded) + one property load (state check for circular dependencies) for modules that are already loaded, so I think it's fine to just inline these as they are followed by more expensive operations that will shadow the overhead of require()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobJingleheimer reacted with eyes emoji
All reactions
  • 👀 1 reaction
@bnb

bnb commented Nov 28, 2022

Copy link
Copy Markdown
Member

this is awesome, amazing work @joyeecheung

JakobJingleheimer and ruyadorno reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Nov 28, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

From the CI:

I think it's okay/predictable for the require-builtins and require-cachable benchmarks of the main process to regress a bit in favor of semicolon and the worker benchmarks. Most applications really only need a subset of the builtins, instead of all of them, and the modules removed here IMO either only work for a specific type of application (but not others), or there are multiple alternatives of them so it makes more sense to only pay the cost of one of them (when the user actually need them) instead of eagerly loading all the alternatives and paying for the extra cost.

17:49:10                                                                                   confidence improvement accuracy (*)   (**)  (***)
17:49:11 misc/startup.js mode='process' script='benchmark/fixtures/require-builtins' dur=1        ***     -4.80 %       ±2.32% ±3.10% ±4.05%
17:49:11 misc/startup.js mode='process' script='benchmark/fixtures/require-cachable' dur=1        ***     -9.93 %       ±2.27% ±3.01% ±3.93%
17:49:11 misc/startup.js mode='process' script='test/fixtures/semicolon' dur=1                    ***     16.66 %       ±1.78% ±2.37% ±3.09%
17:49:11 misc/startup.js mode='worker' script='benchmark/fixtures/require-builtins' dur=1         ***     11.31 %       ±4.03% ±5.38% ±7.04%
17:49:11 misc/startup.js mode='worker' script='benchmark/fixtures/require-cachable' dur=1         ***      6.71 %       ±2.01% ±2.68% ±3.49%
17:49:11 misc/startup.js mode='worker' script='test/fixtures/semicolon' dur=1                     ***     36.80 %       ±2.69% ±3.59% ±4.69%
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Nov 28, 2022
View reviewed changes
Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Nov 28, 2022
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
anonrig
anonrig approved these changes Nov 29, 2022
View reviewed changes

@anonrig anonrig left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic work. lgtm!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@anonrig

anonrig commented Nov 29, 2022

Copy link
Copy Markdown
Member

cc @nodejs/performance

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

daeyeon
daeyeon approved these changes Nov 29, 2022
View reviewed changes

@daeyeon daeyeon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing the number of reduced modules bootstrapped. Thanks for this great work!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobJingleheimer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@GeoffreyBooth

GeoffreyBooth commented Nov 29, 2022

Copy link
Copy Markdown
Member

Can you please summarize the overall benefit of this change? I assume it produces a faster startup (?) and how much faster does it get?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

I assume it produces a faster startup (?) and how much faster does it get?

@GeoffreyBooth did you see #45659 (comment)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 29, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/48235/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig

anonrig commented Nov 29, 2022

Copy link
Copy Markdown
Member

@joyeecheung Can you fix the js lint errors?

/home/runner/work/node/node/lib/internal/util.js
[10](https://github.com/nodejs/node/actions/runs/3575782975/jobs/6012760242#step:5:11)
Error:   508:14  error  Multiple spaces found before '='  no-multi-spaces
[11](https://github.com/nodejs/node/actions/runs/3575782975/jobs/6012760242#step:5:12)

[12](https://github.com/nodejs/node/actions/runs/3575782975/jobs/6012760242#step:5:13)
✖ 1 problem (1 error, 0 warnings)
[13](https://github.com/nodejs/node/actions/runs/3575782975/jobs/6012760242#step:5:14)
  1 error and 0 warnings potentially fixable with the `--fix` option.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Nov 29, 2022

Copy link
Copy Markdown
Member

@GeoffreyBooth did you see #45659 (comment)?

Yes, but I don’t know how to interpret that. Is the semicolon benchmark a proxy for “start up and do nothing”? So base startup is 17% faster?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig

anonrig commented Nov 29, 2022

Copy link
Copy Markdown
Member

@GeoffreyBooth did you see #45659 (comment)?

Yes, but I don’t know how to interpret that. Is the semicolon benchmark a proxy for “start up and do nothing”? So base startup is 17% faster?

@GeoffreyBooth Startup benchmark only benchmarks the startup time of a Node.js application. Loading a semicolon is a way of not calling any of the node applications, and benchmark the load time of all essential packages in Node.js (which directly effects the load time)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Nov 29, 2022

Copy link
Copy Markdown
Member

Startup benchmark only benchmarks the startup time of a Node.js application. Loading a semicolon is a way of not calling any of the node applications, and benchmark the load time of all essential packages in Node.js (which directly effects the load time)

Okay, so is this a benchmark of how long Node itself takes to startup, when loading an application that does nothing? So therefore it’s fair to say that for the “noop app” case, this PR makes Node start up 17% faster?

anonrig reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Nov 29, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

So therefore it’s fair to say that for the “noop app” case, this PR makes Node start up 17% faster?

The benchmark is 99.9% confident that this PR improves the performance from 16.66 % - 3.09% up to 16.66 % + 3.09%. 17% is in this range, but it can be any other value in this range. Also, the benchmark is run on a specific machine, on a specific platform, so if you run it again on a different machine you are very likely to get a different figure. The prudent takeaway is "this PR makes Node.js start up faster", trying to be more specific is more likely to get you away from the truth than closer to it.

ljharb and ruyadorno reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobJingleheimer
JakobJingleheimer approved these changes Nov 29, 2022
View reviewed changes

@JakobJingleheimer JakobJingleheimer left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huzzah 🙌

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/internal/modules/esm/loader.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/modules/esm/loader.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Nov 30, 2022

Copy link
Copy Markdown
Member

trying to be more specific is more likely to get you away from the truth than closer to it.

I think we should have some language that’s friendly enough that we can put it in the release notes. Making the runtime start 17-ish percent faster is a headline; so if that’s too imprecise, let’s come up with an alternative summary that’s still correct but not pedantic. @joyeecheung is it possible to pull the “semicolon” benchmark numbers for all the machines/platforms we test on? So that we can phrase a release note like “The node binary now starts up X% to Y% faster when loading an empty application, as measured on X CI machines covering X platforms.”

JakobJingleheimer and tonivj5 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth GeoffreyBooth added notable-change PRs with changes that should be highlighted in changelogs. performance Issues and PRs related to the performance of Node.js. and removed needs-ci PRs that need a full CI run. labels Nov 30, 2022
jasnell
jasnell approved these changes Nov 30, 2022
View reviewed changes
@github-actions github-actions Bot mentioned this pull request Nov 30, 2022
CI Reliability 2022-11-30 nodejs/reliability#444
Open
15 tasks
@aduh95 aduh95 added the needs-ci PRs that need a full CI run. label Nov 30, 2022
@joyeecheung

joyeecheung commented Nov 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

“The node binary now starts up X% to Y% faster when loading an empty application, as measured on X CI machines covering X platforms.”

That's not how I would frame this PR, because this is only fixing a regression caused by being too careless about loading non-essential modules before, the startup is still slower compared to previous release lines. Part of the regression can be attributed to the "bloating" of the core - many of the modules loaded here were only added in recent releases, on main out/Release/node -p "process.moduleLoadList.join('\n')" | wc -l is 186, while it was ~136 for v16, ~88 for v14, this PR takes it back to 97. Another suspect can be the use of primordials, it could slow down the creation of vm contexts even with the help of the snapshots (-90% without snapshot, -30% with snapshot, from #44252 (comment)) . Even node --version, which involves no JS execution, has been much slower than before, which I am still looking into.

aduh95, GeoffreyBooth, styfle, and bnb reacted with thumbs up emoji
All reactions
  • 👍 4 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Nov 30, 2022
View reviewed changes
Comment thread benchmark/fixtures/require-cachable.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@danielleadams danielleadams added the backport-requested-v18.x label Dec 30, 2022
@danielleadams danielleadams mentioned this pull request Dec 30, 2022
test: order list alphabetically in test-bootstrap-modules #45808
Merged
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@aduh95 @danielleadams
crypto: simplify lazy loading of internal modules
add30f8
The internal `require()` is actually just one map load (to see if the
module is already loaded) + one property load (state check for circular
dependencies) for modules that are already loaded.

Refs: #45659 (comment)
PR-URL: #45809
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
@joyeecheung

joyeecheung commented Dec 31, 2022

Copy link
Copy Markdown
Member Author

@danielleadams I think this probably needs more of a rewrite for v18.x instead of a simple backport. Will do it after the new years holidays

mcollina, RafaelGSS, and styfle reacted with heart emoji
All reactions
  • ❤️ 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@aduh95 @danielleadams
crypto: simplify lazy loading of internal modules
bac6b7d
The internal `require()` is actually just one map load (to see if the
module is already loaded) + one property load (state check for circular
dependencies) for modules that are already loaded.

Refs: #45659 (comment)
PR-URL: #45809
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 5, 2023
@aduh95 @danielleadams
crypto: simplify lazy loading of internal modules
a2230ad
The internal `require()` is actually just one map load (to see if the
module is already loaded) + one property load (state check for circular
dependencies) for modules that are already loaded.

Refs: #45659 (comment)
PR-URL: #45809
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
@juanarbol juanarbol mentioned this pull request Jan 22, 2023
crypto: fix remaining WebCryptoAPI idlharness WPTs #45857
Closed
@joyeecheung

joyeecheung commented Jan 23, 2023

Copy link
Copy Markdown
Member Author

This would need a non-semver-major version of #44483 to backport properly

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Jan 23, 2023

Copy link
Copy Markdown
Contributor

@joyeecheung is it correct that you actually only need to pull from #44483 the changes made in lib/internal/validators.js and some of those made in lib/internal/bootstrap/browser.js? If so, that seems certainly feasible to do a non-semver-major backport. Otherwise, it seems very hard to backport anything else from that PR without risking breaking something somewhere.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Jan 23, 2023

Copy link
Copy Markdown
Member Author

@aduh95 Not sure if this explanation makes sense - I need to pull in the changes to the module graph, ideally including some of the refactoring that reduces the conflicts

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@KhafraDev KhafraDev mentioned this pull request Jan 24, 2023
Make test pass in v19.x nodejs/undici#1879
Merged
@joyeecheung joyeecheung mentioned this pull request Jan 30, 2023
[v18.x] backport startup performance patches #46425
Closed
panva pushed a commit to joyeecheung/node that referenced this pull request Jan 31, 2023
@joyeecheung @panva
bootstrap: lazy load non-essential modules
ae16e0f
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

PR-URL: nodejs#45659
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
@KhafraDev KhafraDev mentioned this pull request Feb 4, 2023
FormData, Response, Request, and Headers have incorrect property descriptors #45099
Open
@cjihrig cjihrig mentioned this pull request Feb 22, 2023
Cannot redefine property when accessing properties of freezed global #46788
Open
@joyeecheung joyeecheung mentioned this pull request Mar 22, 2023
src: bootstrap prepare stack trace callback in shadow realm #47107
Merged
@merceyz merceyz mentioned this pull request Apr 22, 2023
fix(pnp): disable patching binding.fstat when possible yarnpkg/berry#5402
Merged
3 tasks done
targos pushed a commit to joyeecheung/node that referenced this pull request Oct 28, 2023
@joyeecheung @targos
bootstrap: lazy load non-essential modules
9960b3d
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

PR-URL: nodejs#45659
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
targos pushed a commit that referenced this pull request Nov 10, 2023
@joyeecheung @targos
bootstrap: lazy load non-essential modules
6466acb
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

PR-URL: #45659
Backport-PR-URL: #46425
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
@targos targos mentioned this pull request Nov 28, 2023
v18.19.0 release proposal #50953
Merged
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
bootstrap: lazy load non-essential modules
beb5737
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

PR-URL: nodejs/node#45659
Backport-PR-URL: nodejs/node#46425
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
bootstrap: lazy load non-essential modules
6d6a8c8
It turns out that even with startup snapshots, there is a non-trivial
overhead for loading internal modules. This patch makes the loading
of the non-essential modules lazy again.

Caveat: we have to make some of the globals lazily-loaded too,
so the WPT runner is updated to test what the state of the global
scope is after the globals are accessed (and replaced with the
loaded value).

PR-URL: nodejs/node#45659
Backport-PR-URL: nodejs/node#46425
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
@joyeecheung joyeecheung mentioned this pull request Jul 9, 2024
lib: make navigator not runtime-lookup process.version, arch, or platform #53765
Merged
@mhayk mhayk mentioned this pull request Jul 20, 2026
deps,test: fix undici globals on frozen globalThis #64622
Closed
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ljharb ljharb ljharb left review comments
@panva panva panva left review comments
@mcollina mcollina mcollina approved these changes
@jasnell jasnell jasnell approved these changes
@bnb bnb bnb approved these changes
@anonrig anonrig anonrig approved these changes
@JakobJingleheimer JakobJingleheimer JakobJingleheimer approved these changes
@JungMinu JungMinu JungMinu approved these changes
@daeyeon daeyeon daeyeon approved these changes
@aduh95 aduh95 aduh95 approved these changes
@RafaelGSS RafaelGSS RafaelGSS approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

15 participants

@joyeecheung @nodejs-github-bot @bnb @anonrig @GeoffreyBooth @aduh95 @danielleadams @ljharb @mcollina @panva @jasnell @JakobJingleheimer @JungMinu @daeyeon @RafaelGSS
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.