Skip to content

Benchmarks

Aaron Riekenberg edited this page Feb 16, 2024 · 102 revisions

Test System

  • 15-inch Macbook Air M2, 2023 (my personal laptop)
  • rust-parallel uses 8 parallel jobs by default on this machine
  • MacOS 14.2.1

Test Setup

Summary

  • rust-parallel is 1.29 times faster when the path cache is enabled (this is enabled by default)
  • rust-parallel is 1.54 times faster than xargs with 8 processes. Note that this use of xargs does not prevent output interleaving.
  • rust-parallel is 12.33 times faster than GNU parallel

Versions

$ rust-parallel -V
rust-parallel 1.16.0

$ parallel -V
GNU parallel 20240122

Results

Benchmark 1: seq 1 1000 | rust-parallel echo
  Time (mean ± σ):     158.5 ms ±   1.0 ms    [User: 220.2 ms, System: 607.8 ms]
  Range (min … max):   156.4 ms … 159.9 ms    18 runs

Benchmark 2: seq 1 1000 | rust-parallel --disable-path-cache echo
  Time (mean ± σ):     203.1 ms ±   0.7 ms    [User: 235.3 ms, System: 839.0 ms]
  Range (min … max):   202.2 ms … 204.5 ms    14 runs

Benchmark 3: seq 1 1000 | xargs -P8 -L1 echo
  Time (mean ± σ):     244.0 ms ±   1.7 ms    [User: 144.2 ms, System: 511.3 ms]
  Range (min … max):   241.7 ms … 248.3 ms    12 runs

Benchmark 4: seq 1 1000 | parallel echo
  Time (mean ± σ):      1.955 s ±  0.026 s    [User: 2.559 s, System: 3.603 s]
  Range (min … max):    1.924 s …  1.987 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.54 ± 0.01 times faster than seq 1 1000 | xargs -P8 -L1 echo
   12.33 ± 0.18 times faster than seq 1 1000 | parallel echo
Clone this wiki locally