Benchmarks - aaronriekenberg/rust-parallel GitHub Wiki
Test System
- 15-inch Macbook Air M2, 2023 (my personal laptop)
rust-parallel
uses 8 parallel jobs by default on this machine
- MacOS 14.3.1
Test Setup
Summary
- rust-parallel is 1.28 times faster when the path cache is enabled (this is enabled by default)
- rust-parallel is 1.53 times faster than xargs with 8 processes. Note that this use of xargs does not prevent output interleaving.
- rust-parallel is 12.20 times faster than GNU parallel
Versions
$ rust-parallel -V
rust-parallel 1.17.0
$ parallel -V
GNU parallel 20240222
Results
Benchmark 1: seq 1 1000 | rust-parallel echo
Time (mean ± σ): 157.8 ms ± 0.8 ms [User: 221.4 ms, System: 606.8 ms]
Range (min … max): 156.0 ms … 159.2 ms 18 runs
Benchmark 2: seq 1 1000 | rust-parallel --disable-path-cache echo
Time (mean ± σ): 202.6 ms ± 1.3 ms [User: 234.0 ms, System: 836.7 ms]
Range (min … max): 200.7 ms … 204.8 ms 14 runs
Benchmark 3: seq 1 1000 | xargs -P8 -L1 echo
Time (mean ± σ): 242.2 ms ± 1.1 ms [User: 144.3 ms, System: 509.8 ms]
Range (min … max): 240.6 ms … 243.9 ms 12 runs
Benchmark 4: seq 1 1000 | parallel echo
Time (mean ± σ): 1.925 s ± 0.011 s [User: 2.543 s, System: 3.530 s]
Range (min … max): 1.910 s … 1.945 s 10 runs
Summary
seq 1 1000 | rust-parallel echo ran
1.28 ± 0.01 times faster than seq 1 1000 | rust-parallel --disable-path-cache echo
1.53 ± 0.01 times faster than seq 1 1000 | xargs -P8 -L1 echo
12.20 ± 0.09 times faster than seq 1 1000 | parallel echo