node/lib/internal/bootstrap/switches
Joyee Cheung 3dbd686218
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>
2022-12-16 12:44:18 +01:00
..
does_not_own_process_state.js lib: move initialization of APIs for changing process state 2020-01-06 06:54:17 -08:00
does_own_process_state.js process: fix uid/gid validation to avoid crash 2022-10-10 01:12:15 +00:00
is_main_thread.js bootstrap: optimize modules loaded in the built-in snapshot 2022-12-16 12:44:18 +01:00
is_not_main_thread.js lib: use null-prototype objects for property descriptors 2022-06-03 09:23:58 +01:00