mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
d24c6ea27f
Since we are snapshotting extension source at build time, there's no need to define list of sources for the extension at runtime. This commit changes "deno_node" extension by removing "init_polyfill" function in favor of "init_polyfill_ops_and_esm()" and "init_polyfill_ops()". The former is used during snapshot and when "deno_runtime" is compiled with "dont_create_runtime_snapshot" cargo feature flag. The latter is used when running a worker from an existing snapshot. This is a start of a bigger refactor to all extensions - thanks to this change, we don't have to iterate over all defined source files for extension at runtime, and because of that we don't have to create a filepath for each of the source files. It's not a big deal, but we are iterating over 300 files on each start, and concatenating 3 strings before creating a "PathBuf" for ~200 of them. This is already visible on the startup flamegraphs and should be avoided. |
||
---|---|---|
.. | ||
crypto | ||
polyfills | ||
01_node.js | ||
02_require.js | ||
Cargo.toml | ||
errors.rs | ||
idna.rs | ||
lib.rs | ||
module_es_shim.js | ||
ops.rs | ||
package_json.rs | ||
path.rs | ||
polyfill.rs | ||
README.md | ||
resolution.rs | ||
v8.rs | ||
winerror.rs |
deno_node
require
and other node related functionality for Deno.