diff --git a/benchmark/ConcurrentCollectionsBenchmarks/src/bench_queue_hot_potato.jl b/benchmark/ConcurrentCollectionsBenchmarks/src/bench_queue_hot_potato.jl index cc505bd..fe96f0c 100644 --- a/benchmark/ConcurrentCollectionsBenchmarks/src/bench_queue_hot_potato.jl +++ b/benchmark/ConcurrentCollectionsBenchmarks/src/bench_queue_hot_potato.jl @@ -31,6 +31,9 @@ end ntasks::Integer = Threads.nthreads(), duration::Union{Real,Nothing} = nothing, nrepeat::Integer = duration === nothing ? 2^15 : typemax(Int64), + delay::Real = 0, # not using 0.001 mentioned in Izraelevitz & Scott (2017) + nfills::Integer = 0, + ppush::Real = 0.5, ) ntasks < 1 && error("require positive `ntasks`: got $ntasks") local tasks @@ -43,17 +46,18 @@ end local npop = 0 for irepeat in 1:nrepeat # ccall(:jl_breakpoint, Cvoid, (Any,), (; irepeat, itask)) - if rand(Bool) + if rand() < ppush push!(q, NOTPOTATO) npush += 1 else y = popfirst!(q) npop += 1 if y == HOTPOTATO - # Since there are GC pauses, maybe there's no need - # to add sleep here. - # unfair_sleep(0.001) - # sleep(0.001) + for _ in 1:nfills + push!(q, NOTPOTATO) + end + unfair_sleep(delay) + # sleep(delay) push!(q, y) npush += 1 end diff --git a/benchmark/hotpotato/plot.jl b/benchmark/hotpotato/plot.jl index 3f56c43..e0c24cc 100644 --- a/benchmark/hotpotato/plot.jl +++ b/benchmark/hotpotato/plot.jl @@ -54,7 +54,7 @@ plt = @vlplot( x = {:ntasks, title = "Number of Tasks"}, y = {:throughput, title = "Throughput [#OP/second]"}, color = :Implementation, - title = "Hot Potato Benchmark", + # title = "Hot Potato Benchmark", data = datadf, ) @@ -77,7 +77,7 @@ plt_speedup = @vlplot( :point, x = {:ntasks, title = "Number of Tasks"}, y = {:speedup, title = "Speedup [DLCRQ/Base]"}, - title = "Hot Potato Benchmark (Speedup)", + # title = "Hot Potato Benchmark (Speedup)", data = summarydf, ) @@ -91,7 +91,7 @@ plt_trialid = @vlplot( :trialid, scale = {scheme = :magma}, }, - title = "Hot Potato Benchmark", + # title = "", data = datadf[datadf.impl .== :base, :], )