Closed
Description
@oschulz identified a fairly major performance regression with multithreading within SolidStateDetectors; I confirmed the regression, further minimized it, and pushed it to https://github.com/mbauman/MultithreadPerf32701. There's still room for further minimization, but in short:
shell> env JULIA_NUM_THREADS=1 ~/julia/release-1.1/julia --project=. benchmark.jl
[ Info: 1.1.1-pre.2: 1 threads
BenchmarkTools.Trial:
memory estimate: 160 bytes
allocs estimate: 6
--------------
minimum time: 15.537 μs (0.00% GC)
median time: 15.618 μs (0.00% GC)
mean time: 15.669 μs (0.00% GC)
maximum time: 33.078 μs (0.00% GC)
--------------
samples: 10000
evals/sample: 1
shell> env JULIA_NUM_THREADS=20 ~/julia/release-1.1/julia --project=. benchmark.jl
[ Info: 1.1.1-pre.2: 20 threads
BenchmarkTools.Trial:
memory estimate: 160 bytes
allocs estimate: 6
--------------
minimum time: 3.963 μs (0.00% GC)
median time: 4.445 μs (0.00% GC)
mean time: 4.487 μs (0.00% GC)
maximum time: 6.338 μs (0.00% GC)
--------------
samples: 10000
evals/sample: 7
shell> env JULIA_NUM_THREADS=1 julia --project=. benchmark.jl
[ Info: 1.3.0-alpha.10: 1 threads
BenchmarkTools.Trial:
memory estimate: 864 bytes
allocs estimate: 9
--------------
minimum time: 20.437 μs (0.00% GC)
median time: 20.601 μs (0.00% GC)
mean time: 20.992 μs (0.00% GC)
maximum time: 73.357 μs (0.00% GC)
--------------
samples: 10000
evals/sample: 1
shell> env JULIA_NUM_THREADS=20 julia --project=. benchmark.jl
[ Info: 1.3.0-alpha.10: 20 threads
BenchmarkTools.Trial:
memory estimate: 14.94 KiB
allocs estimate: 142
--------------
minimum time: 60.928 μs (0.00% GC)
median time: 76.579 μs (0.00% GC)
mean time: 78.658 μs (1.86% GC)
maximum time: 7.549 ms (97.44% GC)
--------------
samples: 10000
evals/sample: 1