This allows us to parse source files in parallel for the first run:
Benchmark 1: ../deno/deno_old run -A ts_morph.ts
Time (mean ± σ): 2.332 s ± 0.017 s [User: 2.193 s, System: 0.126 s]
Range (min … max): 2.307 s … 2.366 s 10 runs
Benchmark 2: ../deno/target/release/deno run -A ts_morph.ts
Time (mean ± σ): 1.052 s ± 0.006 s [User: 2.259 s, System: 0.132 s]
Range (min … max): 1.040 s … 1.060 s 10 runs
Summary
../deno/target/release/deno run -A ts_morph.ts ran
2.22 ± 0.02 times faster than ../deno/deno_old run -A ts_morph.ts
scratch % cat ts_morph.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";
Same speed on second run:
Benchmark 1: ../deno/deno_old run -A ts_morph.ts
Time (mean ± σ): 419.2 ms ± 3.7 ms [User: 390.3 ms, System: 40.7 ms]
Range (min … max): 415.1 ms … 428.8 ms 10 runs
Benchmark 2: ../deno/target/release/deno run -A ts_morph.ts
Time (mean ± σ): 415.4 ms ± 4.6 ms [User: 385.7 ms, System: 39.6 ms]
Range (min … max): 412.2 ms … 425.1 ms 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Summary
../deno/target/release/deno run -A ts_morph.ts ran
1.01 ± 0.01 times faster than ../deno/deno_old run -A ts_morph.ts
This allows us to parse source files in parallel for the first run:
Same speed on second run:
Closes https://github.com/denoland/deno_graph/issues/474