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.4.1

Test Setup

Summary

  • rust-parallel is 1.66 times faster than xargs with 8 processes. Note that this use of xargs does not prevent output interleaving.
  • rust-parallel is 13.98 times faster than GNU parallel

Versions

$ rust-parallel -V
rust-parallel 1.18.1

$ parallel -V
GNU parallel 20240422

Results

Benchmark 1: seq 1 1000 | rust-parallel echo
  Time (mean ± σ):     141.2 ms ±   1.3 ms    [User: 237.0 ms, System: 584.8 ms]
  Range (min … max):   139.3 ms … 144.5 ms    21 runs

Benchmark 2: seq 1 1000 | xargs -P8 -L1 echo
  Time (mean ± σ):     235.0 ms ±   1.0 ms    [User: 151.0 ms, System: 457.4 ms]
  Range (min … max):   233.3 ms … 236.9 ms    12 runs

Benchmark 3: seq 1 1000 | parallel echo
  Time (mean ± σ):      1.974 s ±  0.028 s    [User: 2.674 s, System: 3.099 s]
  Range (min … max):    1.945 s …  2.039 s    10 runs

Summary
  seq 1 1000 | rust-parallel echo ran
    1.66 ± 0.02 times faster than seq 1 1000 | xargs -P8 -L1 echo
   13.98 ± 0.24 times faster than seq 1 1000 | parallel echo