-
Notifications
You must be signed in to change notification settings - Fork 9
Benchmarks
Aaron Riekenberg edited this page Nov 25, 2023
·
102 revisions
- 15-inch Macbook Air M2, 2023 (my personal laptop)
-
rust-parallel
uses 8 parallel jobs by default on this machine - MacOS 14.1.1
- Run
echo
on 1000 strings1
to1000
- Benchmarks run using hyperfine testing tool
- Link to benchmark script
- rust-parallel is 1.35 times faster when the path cache is enabled (this is enabled by default)
- rust-parallel is 2.09 times faster than xargs with 8 processes. Note that this use of xargs does not prevent output interleaving.
- rust-parallel is 11.80 times faster than GNU parallel
$ rust-parallel -V
rust-parallel 1.11.0
$ parallel -V
GNU parallel 20231122
$ hyperfine --warmup 3 \
'seq 1 1000 | rust-parallel echo' \
'seq 1 1000 | rust-parallel --disable-path-cache echo' \
'seq 1 1000 | xargs -P8 -L1 echo' \
'seq 1 1000 | parallel echo'
Benchmark 1: seq 1 1000 | rust-parallel echo
Time (mean ± σ): 166.3 ms ± 0.9 ms [User: 218.6 ms, System: 611.7 ms]
Range (min … max): 164.7 ms … 168.1 ms 17 runs
Benchmark 2: seq 1 1000 | rust-parallel --disable-path-cache echo
Time (mean ± σ): 225.2 ms ± 1.1 ms [User: 260.1 ms, System: 872.6 ms]
Range (min … max): 223.7 ms … 227.7 ms 13 runs
Benchmark 3: seq 1 1000 | xargs -P8 -L1 echo
Time (mean ± σ): 347.0 ms ± 1.7 ms [User: 154.7 ms, System: 522.4 ms]
Range (min … max): 345.0 ms … 349.8 ms 10 runs
Benchmark 4: seq 1 1000 | parallel echo
Time (mean ± σ): 1.961 s ± 0.018 s [User: 2.545 s, System: 3.484 s]
Range (min … max): 1.940 s … 1.995 s 10 runs
Summary
seq 1 1000 | rust-parallel echo ran
1.35 ± 0.01 times faster than seq 1 1000 | rust-parallel --disable-path-cache echo
2.09 ± 0.02 times faster than seq 1 1000 | xargs -P8 -L1 echo
11.80 ± 0.13 times faster than seq 1 1000 | parallel echo