You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unification benchmark using 'map' and 'stream' (#798)
Resolves#796
It's an OK (not great, not terrible) benchmark:
1. generates two nested, deep pair types like `(...((XLLL, XLLR), (XLRL,
XLRR)), ...` for `X = { A, B }`,
2. then unifies them,
3. and checks that the substitutions are like `ALLL -> BLLL`.
Configurable with a given `N` if some tweaking is needed.
### Perf:
#### My machine
On my computer with `N = 12`:
- JS compilation only: 4.5s
- LLVM compilation only: 5.5s
- then hyperfined:
```
$ hyperfine --warmup 5 --min-runs 20 './out/unify-js' './out/unify-llvm'
Benchmark 1: ./out/unify-js
Time (mean ± σ): 703.0 ms ± 7.8 ms [User: 1035.2 ms, System: 77.1 ms]
Range (min … max): 690.9 ms … 721.1 ms 20 runs
Benchmark 2: ./out/unify-llvm
Time (mean ± σ): 37.6 ms ± 0.5 ms [User: 36.1 ms, System: 1.0 ms]
Range (min … max): 37.1 ms … 39.7 ms 69 runs
Summary
./out/unify-llvm ran
18.68 ± 0.32 times faster than ./out/unify-js
```
On my computer with `N = 16` (16x more work than `N = 12`)
- JS compilation only: 4.7s
- LLVM compilation only: 5.6s
- then hyperfined:
```
Benchmark 1: ./out/unify-js
Time (mean ± σ): 19.982 s ± 0.608 s [User: 26.011 s, System: 1.525 s]
Range (min … max): 19.300 s … 21.267 s 20 runs
Benchmark 2: ./out/unify-llvm
Time (mean ± σ): 928.2 ms ± 20.8 ms [User: 906.3 ms, System: 16.1 ms]
Range (min … max): 913.3 ms … 1006.2 ms 20 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
./out/unify-llvm ran
21.53 ± 0.81 times faster than ./out/unify-js
```
#### CI
With `N = 12` in CI (measured imprecisely in two CI rounds):
- 9.2-12.0 seconds on Chez backends
- 8.0-8.9 seconds on JS
- 9.9-12.7 seconds on LLVM
With `N = 16` in CI (measured imprecisely in two CI rounds):
- 21-29 seconds on Chez backends
- 55-57 seconds on JS
- 79-86 seconds on LLVM
---------
Co-authored-by: Jonathan Brachthäuser <[email protected]>
0 commit comments