-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
In theory, we can move the load of content of a module to C++ when:
- the experimental policy is not enabled
- and when the module is not ESM
- and when the module is not patched
Since the content
goes directly to the C++ without modification:
- https://github.com/nodejs/node/blob/main/lib/internal/modules/cjs/loader.js#L1288
- https://github.com/nodejs/node/blob/main/lib/internal/vm.js#L78
- https://github.com/nodejs/node/blob/95b198911382b0aa0a0448e2a86214558665e02b/src/node_contextify.cc#L975
Also, I don't have any idea if worth or is viable but maybe we could use StreamedSource instead of Source
, in this way, we probably can save some memory and load the script much faster.
Let me know what you think, this is something that was in my mind for a while and I just wanna to share it with more people to understand if is possible or not.
Metadata
Metadata
Assignees
Labels
No labels