node/lib/internal/bootstrap
Joyee Cheung 6e3d7f8c2d
bootstrap: optimize modules loaded in the built-in snapshot
Preload essential modules and lazy-load non-essential ones.
After this patch, all modules listed by running this snippet:

```
const list = process.moduleLoadList.join('\n');
require('fs').writeSync(1, list, 'utf-8');
```

(which is roughly the same list as the one in
test-bootstrap-module.js for the main thread)
are loaded from the snapshot so no additional compilation cost
is incurred.

PR-URL: https://github.com/nodejs/node/pull/45849
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-01-01 10:44:49 +00:00
..
switches bootstrap: optimize modules loaded in the built-in snapshot 2023-01-01 10:44:49 +00:00
browser.js bootstrap: include event_target into the built-in snapshot 2023-01-01 10:44:48 +00:00
loaders.js lib: disambiguate native module to builtin module 2022-12-13 09:42:42 +00:00
node.js util: use private symbols in JS land directly 2022-12-13 09:42:45 +00:00