0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-04 09:57:11 -05:00
deno/cli/npm
Nathan Whitaker d5e3d26df8 perf(install): only read initialized file if we care about the tags (#28242)
Speeds up the caching part of this arbitrary `"nodeModulesDir": "auto"`
project by about 22%

We write the tags associated with a given npm package to the
`.initialized` file, so that byonm can correctly resolve tags. When
setting up the node modules dir, we read that file to see if we need to
update the tags.

If we don't have any tags associated with the package though, we can
just check for existence (which is a fair bit faster than trying to
`open` + `read` a file).

```
❯ hyperfine --warmup 3 "deno check src/**/*.ts" "../deno/target/release-lite/deno check src/**/*.ts"
Benchmark 1: deno check src/**/*.ts
  Time (mean ± σ):     369.9 ms ±   5.5 ms    [User: 286.9 ms, System: 128.9 ms]
  Range (min … max):   361.7 ms … 377.7 ms    10 runs

Benchmark 2: ../deno/target/release-lite/deno check src/**/*.ts
  Time (mean ± σ):     303.5 ms ±   5.9 ms    [User: 210.9 ms, System: 124.5 ms]
  Range (min … max):   292.7 ms … 315.0 ms    10 runs

Summary
  ../deno/target/release-lite/deno check src/**/*.ts ran
    1.22 ± 0.03 times faster than deno check src/**/*.ts
```
2025-02-25 11:03:28 +05:30
..
installer perf(install): only read initialized file if we care about the tags (#28242) 2025-02-25 11:03:28 +05:30
managed.rs refactor: move denort to separate crate (#27688) 2025-01-17 20:39:29 +00:00
mod.rs refactor(lsp): remove Send + Sync requirement (#28035) 2025-02-12 13:37:47 +00:00