1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/cli
Nathan Whitaker 2024c974b6
perf(cli): Improve concurrency when setting up node_modules and loading cached npm package info (#24018)
The same issue in two different places - doing blocking FS work in an
async task, limiting the amount of work that happens concurrently.

- When setting up node_modules, where we try to set up entries
concurrently but were blocking other tasks from actually running.
- When loading package info from the npm registry file cache, loading
and deserializing is expensive and prevents concurrency. This was
especially noticeable when loading an npm resolution snapshot from a
lockfile (`snapshot_from_lockfile` in `deno_npm`).

Installing deps in `deno-docs`:

```
❯ hyperfine -i -p 'rm -rf node_modules/' '../d7/deno-main i' '../d7/target/release/deno i'
Benchmark 1: ../d7/deno-main i
  Time (mean ± σ):      2.193 s ±  0.027 s    [User: 0.589 s, System: 1.033 s]
  Range (min … max):    2.151 s …  2.242 s    10 runs

Benchmark 2: ../d7/target/release/deno i
  Time (mean ± σ):      1.597 s ±  0.021 s    [User: 0.977 s, System: 1.337 s]
  Range (min … max):    1.550 s …  1.627 s    10 runs

Summary
  ../d7/target/release/deno i ran
    1.37 ± 0.02 times faster than ../d7/deno-main i
```

Caching `npm:@11ty/eleventy`:
```
❯ hyperfine -i -p 'rm -rf node_modules/' --warmup 5 '../../d7/deno-main cache npm:@11ty/eleventy' '../../d7/target/release/deno cache npm:@11ty/eleventy'
Benchmark 1: ../../d7/deno-main cache npm:@11ty/eleventy
  Time (mean ± σ):     129.9 ms ±   2.2 ms    [User: 27.5 ms, System: 101.3 ms]
  Range (min … max):   127.5 ms … 135.8 ms    10 runs

Benchmark 2: ../../d7/target/release/deno cache npm:@11ty/eleventy
  Time (mean ± σ):     100.6 ms ±   1.3 ms    [User: 38.8 ms, System: 233.8 ms]
  Range (min … max):    99.3 ms … 103.2 ms    10 runs

Summary
  ../../d7/target/release/deno cache npm:@11ty/eleventy ran
    1.29 ± 0.03 times faster than ../../d7/deno-main cache npm:@11ty/eleventy
```

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-28 21:17:36 +00:00
..
args feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
bench refactor: remove custom utc_now in favor of chrono::Utc:now feature (#23888) 2024-05-23 13:59:11 +02:00
cache perf: parse source files in parallel (#23858) 2024-05-28 16:23:11 -04:00
js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
lsp feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
napi chore: forward v1.43.6 release commit to main (#23936) 2024-05-22 01:35:04 +00:00
npm perf(cli): Improve concurrency when setting up node_modules and loading cached npm package info (#24018) 2024-05-28 21:17:36 +00:00
ops refactor(jupyter): use runtimelib for Jupyter structures and directory paths (#23826) 2024-05-21 22:35:21 +02:00
schemas feat(cli): add support for jsxImportSourceTypes (#23419) 2024-04-30 18:12:35 +00:00
standalone feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
tools perf: parse source files in parallel (#23858) 2024-05-28 16:23:11 -04:00
tsc BREAKING(ffi/unstable): always return u64 as bigint (#23981) 2024-05-28 09:31:09 +05:30
util perf(cli): Optimize setting up node_modules on macOS (#23980) 2024-05-28 11:59:17 -07:00
auth_tokens.rs fix(cli): Add IP address support to DENO_AUTH_TOKEN (#22297) 2024-02-06 19:45:40 +01:00
build.rs fix: upgrade TypeScript from 5.4.3 to 5.4.5 (#23740) 2024-05-08 13:54:56 -04:00
Cargo.toml feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
cdp.rs refactor(tools/repl): reorganize code (#21810) 2024-01-05 16:14:58 +01:00
deno.ico fix(cli): add icon and metadata to deno.exe on Windows (#6693) 2020-07-15 21:54:38 +02:00
emit.rs perf(cache): compile ts to js in parallel for deno cache (#23892) 2024-05-20 13:49:12 -04:00
entitlements.plist chore: start codesigning mac release builds (#21303) 2023-11-23 15:30:26 -07:00
errors.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
factory.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
file_fetcher.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
graph_container.rs fix(node): seperate worker module cache (#23634) 2024-05-16 07:09:35 +00:00
graph_util.rs perf: skip npm install if graph has no new packages (#24017) 2024-05-28 16:24:07 -04:00
http_util.rs FUTURE: initial support for .npmrc file (#23560) 2024-05-23 23:26:23 +02:00
integration_tests_runner.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
js.rs chore(cli): remove problematic snapshot test (#22722) 2024-03-05 19:11:33 -07:00
jsr.rs fix(lsp): apply import fix to missing declaration code action (#23924) 2024-05-21 21:15:16 +01:00
main.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
mainrt.rs chore: enable clippy::print_stdout and clippy::print_stderr (#23732) 2024-05-08 22:45:06 -04:00
module_loader.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
node.rs perf: analyze cjs exports and emit typescript in parallel (#23856) 2024-05-18 11:42:03 -04:00
README.md docs(cli): do not need gen doc for cli (#17260) 2023-01-04 13:19:58 +01:00
resolver.rs fix(cli): use CliNodeResolver::resolve() for managed node_modules (#23902) 2024-05-21 17:54:15 +01:00
version.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
worker.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00

Deno CLI Crate

crates

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core to provide the executable.