Benchmark

The benchmark compares AtomicChannel with Base.Channel using a multi-producer multi-consumer (MPMC) workload.

Method Summary

  • Benchmark target: put/take throughput with items=50000
  • Metric: speedup is computed as Channel ÷ AtomicChannel (elapsed time in ms).
  • Scenario groups:
    • Case 1: low-capacity contention (capacity=4 or 1)
    • Case 2: higher-capacity, lower data contention (capacity=256)
    • Case 3: varying worker/task counts (capacity=256)

Representative Results

Representative speedups are shown below from the latest report for each Julia version.

JuliaCase 1: 64 threads, 64 workers, cap=4Case 2: 64 threads, 64 workers, cap=256Case 3: 32 threads, 256 workers, cap=256
1.12.633.8x3.023x27.638x
1.11.99.751x4.4x2.165x
1.10.1113.103x4.876x2.288x
1.9.417.579x6.155x2.367x
1.8.56.311x1.994x1.709x

Conclusion:

  • AtomicChannel are faster than Base.Channel in most test scenarios; drastically faster with heavy task switch and multiple concurrent data operations.

Raw Reports

Reproduce

Run from repository root:

julia --project benchmark/mpmc.jl

Or pin the Julia version with juliaup:

julia +1.12 --project benchmark/mpmc.jl
julia +1.11 --project benchmark/mpmc.jl
julia +1.10 --project benchmark/mpmc.jl
julia +1.9 --project benchmark/mpmc.jl
julia +1.8 --project benchmark/mpmc.jl

Each run generates a versioned report in benchmark/.