Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: parse source files in parallel #23858

Merged
merged 8 commits into from
May 28, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented May 17, 2024

See denoland/deno_graph#477

This is much faster on first run, but the same speed on second run (due to the caches).

First run (on mac m2, 8 cores):

% DENO_DIR=$PWD/.cache hyperfine --warmup=3 --prepare="rm -rf .cache/gen .cache/dep_analysis_cache*" "../deno/deno_old run -A main.ts" "../deno/target/release/deno run -A main.ts"
Benchmark 1: ../deno/deno_old run -A main.ts
  Time (mean ± σ):      2.265 s ±  0.013 s    [User: 2.145 s, System: 0.143 s]
  Range (min … max):    2.239 s …  2.283 s    10 runs
 
Benchmark 2: ../deno/target/release/deno run -A main.ts
  Time (mean ± σ):     943.2 ms ±   5.2 ms    [User: 2230.1 ms, System: 146.9 ms]
  Range (min … max):   934.5 ms … 950.2 ms    10 runs
 
Summary
  ../deno/target/release/deno run -A main.ts ran
    2.40 ± 0.02 times faster than ../deno/deno_old run -A main.ts
scratch % cat main.ts
import "https://deno.land/x/ts_morph@22.0.0/mod.ts";
import "https://deno.land/x/ts_morph@21.0.0/mod.ts";
import "https://deno.land/x/ts_morph@20.0.0/mod.ts";
import "https://deno.land/x/ts_morph@19.0.0/mod.ts";

@dsherret dsherret changed the title perf: parse typescript files in parallel perf: parse source files in parallel May 17, 2024
@dsherret dsherret marked this pull request as ready for review May 28, 2024 19:07
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dsherret dsherret merged commit 57617af into denoland:main May 28, 2024
20 checks passed
@dsherret dsherret deleted the deno_graph_async_module_analysis branch May 28, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants