Summary
Create a benchmark suite to measure and track interpreter performance over time, preventing regressions as features are added.
Motivation
The interpreter already has performance optimizations (expression caching, raw statement compilation, evaluator caching), but there is no way to measure their impact or detect regressions. A benchmark suite is essential as the project grows.
Scope
- A
benchmarks/ directory with JS programs that stress different parts of the runtime
- Categories:
- Arithmetic loops (CPU-bound)
- Array method chains (map/filter/reduce)
- String operations (split/join/replace)
- Function call overhead
- Object property access
- A script to run benchmarks and report timing (
scripts/run_benchmarks.py or similar)
- Optional: CI integration to detect performance regressions (compare against baseline)
Out of scope
- Comparative benchmarking against Node.js/Deno (GiavaScript is not aiming to compete on perf)
- Micro-benchmarking individual Crystal methods
Summary
Create a benchmark suite to measure and track interpreter performance over time, preventing regressions as features are added.
Motivation
The interpreter already has performance optimizations (expression caching, raw statement compilation, evaluator caching), but there is no way to measure their impact or detect regressions. A benchmark suite is essential as the project grows.
Scope
benchmarks/directory with JS programs that stress different parts of the runtimescripts/run_benchmarks.pyor similar)Out of scope