mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
![]() With `nodeModulesDir: auto` (and `none`, to a lesser extent), we frequently repeatedly try to cache npm packages during resolution. On a (private) fresh project, I counted that `sync_resolution_with_fs` was called 478 times over the course of a fresh build. This reduces the number of calls to 8, and doing so speeds things up substantially. ``` ❯ hyperfine --warmup 2 -N "deno task build" "../deno/target/release-lite/deno task build" Benchmark 1: deno task build Time (mean ± σ): 3.652 s ± 0.042 s [User: 3.285 s, System: 2.399 s] Range (min … max): 3.587 s … 3.712 s 10 runs Benchmark 2: ../deno/target/release-lite/deno task build Time (mean ± σ): 1.356 s ± 0.007 s [User: 1.961 s, System: 1.108 s] Range (min … max): 1.345 s … 1.372 s 10 runs Summary ../deno/target/release-lite/deno task build ran 2.69 ± 0.03 times faster than deno task build ``` |
||
---|---|---|
.. | ||
installer | ||
managed.rs | ||
mod.rs |