diff --git a/Jint.Benchmark/README.md b/Jint.Benchmark/README.md index 8dfbd1d79..d47a3d5de 100644 --- a/Jint.Benchmark/README.md +++ b/Jint.Benchmark/README.md @@ -1,8 +1,22 @@ # Engine comparison benchmarks -This project benchmarks Jint against other managed JavaScript engines for .NET +This project benchmarks Jint against the other managed JavaScript engines for .NET ([Jurassic](https://github.com/paiden/Jurassic), [NiL.JS](https://github.com/nilproject/NiL.JS) and -[YantraJS](https://github.com/yantrajs/yantra)) using a set of representative scripts. +[YantraJS](https://github.com/yantrajs/yantra)) across a set of representative scripts. + +## At a glance (Jint 4.11.0) + +Using Jint's recommended production path (a cached prepared script) and comparing against the +**closest competitor** on each script: + +* **Fastest engine on most workloads.** It leads the object, string and regex scripts by **1.7×–5×** + over the next-fastest engine, and starts tiny scripts up **~1.6×–5×** faster. +* **By far the lowest memory use.** Typically **2×–63×** less allocation than the closest competitor + — and up to **330×** less than the highest in the field — which means much lighter GC pressure in + real applications. +* **Two structural gaps remain,** both narrowed in 4.11.0: heavy floating-point/matrix math and + call-plus-`new Date()`-heavy loops, where an engine that compiles JavaScript to IL pulls ahead on + tight numeric loops. ## Running the benchmarks @@ -31,84 +45,83 @@ Notes: parsing cost — **in production you should cache the prepared script**, which is what `Jint_ParsedScript` represents. * The `*-modern` scripts are ES2015+ rewrites (`const`, arrow functions, …) of the classic ES5 - scripts. **Jurassic shows `NA` on every `-modern` row** because it predates ES2015 and cannot + scripts. **Jurassic reports `NA` on every `-modern` row** because it predates ES2015 and cannot parse that syntax. * `Mean` is time per operation (lower is better); `Allocated` is managed memory per operation (lower is better). `Rank` groups results that are statistically tied. -## Highlights — strengths & weaknesses - -Numbers below use Jint's recommended production path (`Jint_ParsedScript`, i.e. a cached prepared -script) unless noted; "field" means the best result from the other three engines. +## Where Jint leads -**Where Jint leads** +Numbers use Jint's recommended production path (`Jint_ParsedScript`, a cached prepared script) and +compare against the closest competitor on each script. -* **Tiny-script latency.** `minimal` 1.7 µs (1.6× faster than the field), `evaluation` 5.0 µs and - `evaluation-modern` 4.9 µs (~5× faster). Jint has almost no per-run engine overhead. -* **Prepared scripts are dramatically faster than re-parsing.** `linq-js` drops from 1,185 µs - (parse every run) to **61 µs** when reused — ~19× — and that is 5.3× faster than the next engine - (YantraJS 325 µs). Cache your `Prepared