denoland / deno_ast

Source text parsing, lexing, and AST related functionality for Deno
https://crates.io/crates/deno_ast
MIT License
144 stars 43 forks source link

perf: turn off jsx transforms for non-jsx compatible files #252

Closed dsherret closed 2 months ago

dsherret commented 2 months ago
> hyperfine --warmup=3 ".\baseline.exe" ".\new.exe"
Benchmark 1: .\baseline.exe
  Time (mean ± σ):     188.0 ms ±   6.6 ms    [User: 58.0 ms, System: 6.6 ms]
  Range (min … max):   181.4 ms … 204.9 ms    14 runs

Benchmark 2: .\new.exe
  Time (mean ± σ):     181.0 ms ±   4.8 ms    [User: 72.3 ms, System: 8.6 ms]
  Range (min … max):   171.9 ms … 193.0 ms    16 runs

Summary
  .\new.exe ran
    1.04 ± 0.05 times faster than .\baseline.exe
dsherret commented 2 months ago

Done here: https://github.com/denoland/deno_ast/pull/252/commits/c9d89dccddaef38000869690247b258b779d2bf2