And for completeness, here’s how the Julia times change if xxx
is made const
:
> julia quicksort.jl
With type unstable ZeroArray wrapper:
BenchmarkTools.Trial: 58 samples with 1 evaluation.
Range (min … max): 85.002 ms … 98.931 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 85.927 ms ┊ GC (median): 0.31%
Time (mean ± σ): 87.055 ms ± 2.816 ms ┊ GC (mean ± σ): 0.33% ± 0.32%
█▄ ▂▅
██▃███▅▁▁▅▁▅▃█▁▁▃▃▃▁▃▃▁▃▁▁▁▁▁▃▃▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃ ▁
85 ms Histogram: frequency by time 97.6 ms <
Memory estimate: 25.94 MiB, allocs estimate: 1700025.
Without ZeroArray wrapper:
BenchmarkTools.Trial: 746 samples with 1 evaluation.
Range (min … max): 6.560 ms … 11.054 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 6.585 ms ┊ GC (median): 0.00%
Time (mean ± σ): 6.695 ms ± 357.016 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
█▄▂▂▄ ▂▁
█████████▅▇▇▅▅▁▅▆▆▆▆▅▄▄▅▅▁▄▁▁▁▁▁▄▁▁▁▁▁▁▄▁▁▁▁▁▁▁▁▁▁▁▁▄▁▁▁▁▄▄ ▇
6.56 ms Histogram: log(frequency) by time 8.56 ms <
Memory estimate: 0 bytes, allocs estimate: 0.