Version benchmark

Less indirection on every hot path.

easy-stack 2.1 replaces two WeakMaps with native private fields. The benchmark compares that implementation with the exact tagged 2.0.0 runtime—same API work, same process, alternating order.

Captured results

Lower is faster. Each value is the median of 21 samples at 100,000 operations on an Intel Core Ultra 9 275HX running Windows x64.

easy-stack 2.1.0 compared with 2.0.0

Horizontal bars show milliseconds per 100,000 operations. Shorter bars are faster; exact values remain in the table below.

2.0.0 · WeakMap 2.1.0 · private fields

Retained construction

Milliseconds per 100,000 instances

Node 22.13 · old78.05
Node 22.13 · new4.36
Node 24.18 · old73.53
Node 24.18 · new3.97

Task-turn scheduling

Milliseconds per 100,000 task turns

Node 22.13 · old5.83
Node 22.13 · new2.43
Node 24.18 · old4.51
Node 24.18 · new2.88
RuntimeScenario2.0.0 · WeakMap2.1.0 · private fieldsSpeedup
Node 22.13.0Construct retained instances78.05 ms4.36 ms17.92×
Node 22.13.0Schedule and run task turns5.83 ms2.43 ms2.40×
Node 24.18.0Construct retained instances73.53 ms3.97 ms18.50×
Node 24.18.0Schedule and run task turns4.51 ms2.88 ms1.57×

Download the captured machine-readable results. Timing varies by machine and load; the repeatable conclusion is the direction and scale of the improvement, not a universal millisecond promise.

Method designed to resist flattering results

  1. Load the exact 2.0.0:stack.cjs source from the repository tag.
  2. Warm both implementations three times before recording samples.
  3. Alternate which implementation runs first to reduce order bias.
  4. Force garbage collection before every timed sample.
  5. Retain every constructed instance through the timed interval so allocations cannot disappear as dead work.
  6. Validate nonzero checksums for every sample and fail on a behavioral mismatch.
  7. Report medians rather than a single best run.
Scope of the claim

The benchmark isolates runner overhead. Real applications also spend time inside their tasks, so end-to-end gains depend on how much work each task performs.

Run it yourself

git clone https://github.com/RIAEvangelist/easy-stack.git
cd easy-stack
npm run benchmark

Override the sample or operation counts without changing the script:

BENCHMARK_SAMPLES=31 BENCHMARK_ITERATIONS=200000 npm run benchmark

The command emits JSON with the runtime, V8 version, platform, processor, methodology, medians, and computed speedups. CI also uploads a fresh benchmark artifact for each successful main build.

Next pageMigration guidance