-
Notifications
You must be signed in to change notification settings - Fork 8
Benchmarks
Aaron Riekenberg edited this page Jul 16, 2023
·
102 revisions
- 15-inch Macbook Air M2, 2023 (my personal laptop)
-
rust-parallel
uses 8 parallel jobs by default on this machine - MacOS 13.4.1
- Run
echo
on 1000 strings1
to1000
- Benchmarks run using hyperfine testing tool
- Link to benchmark script
- rust-parallel is 1.42 times faster when the path cache is enabled (this is enabled by default)
- rust-parallel is 1.65 times faster than xargs with 8 processes
- rust-parallel is 13.36 times faster than GNU parallel
$ rust-parallel -V
rust-parallel 1.5.1
$ parallel -V
GNU parallel 20230622
$ 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 ± σ): 149.9 ms ± 1.0 ms [User: 226.4 ms, System: 742.1 ms]
Range (min … max): 148.3 ms … 151.6 ms 19 runs
Benchmark 2: seq 1 1000 | rust-parallel --disable-path-cache echo
Time (mean ± σ): 212.3 ms ± 1.9 ms [User: 255.1 ms, System: 977.1 ms]
Range (min … max): 208.8 ms … 215.5 ms 14 runs
Benchmark 3: seq 1 1000 | xargs -P8 -L1 echo
Time (mean ± σ): 247.1 ms ± 1.3 ms [User: 146.6 ms, System: 548.2 ms]
Range (min … max): 245.1 ms … 249.5 ms 12 runs
Benchmark 4: seq 1 1000 | parallel echo
Time (mean ± σ): 2.003 s ± 0.011 s [User: 2.450 s, System: 3.591 s]
Range (min … max): 1.987 s … 2.018 s 10 runs
Summary
seq 1 1000 | rust-parallel echo ran
1.42 ± 0.02 times faster than seq 1 1000 | rust-parallel --disable-path-cache echo
1.65 ± 0.01 times faster than seq 1 1000 | xargs -P8 -L1 echo
13.36 ± 0.12 times faster than seq 1 1000 | parallel echo