From cb0990110c064f2189a1ba142d263d0b04a7c933 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 24 Nov 2024 13:07:53 -0600 Subject: [PATCH 1/3] full pipeline seconds=.001 (29.3=>22.9) --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index d46b1f68..31cf31f7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -179,7 +179,7 @@ using Random: rand! # Full pipeline and order of evals log = [] _push!(x, v) = (push!(x, v); v) - x,y = @be _push!(log, (0,)) _push!(log, (_...,1)) _push!(log, (_...,2)), _push!(log, (_...,3)) _push!(log, (_...,4)) + x,y = @be _push!(log, (0,)) _push!(log, (_...,1)) _push!(log, (_...,2)), _push!(log, (_...,3)) _push!(log, (_...,4)) seconds=.001 # Sanity all(∈(((0,), (0,1), (0,1,2), (0,1,3), (0,1,2,4), (0,1,3,4))), log) From 735f162fedc1645800234173a74ea56c0751c259 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 24 Nov 2024 13:09:44 -0600 Subject: [PATCH 2/3] skip Aqua's persistent_task tests (22.9s => 20.5s) --- test/runtests.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 31cf31f7..1181176e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -519,7 +519,8 @@ using Random: rand! @testset "Aqua" begin import Aqua - Aqua.test_all(Chairmarks, deps_compat=false) + # persistent_tasks=false because that test is slow and we don't use persistent tasks + Aqua.test_all(Chairmarks, deps_compat=false, persistent_tasks=false) Aqua.test_deps_compat(Chairmarks, check_extras=false) end From c679f974e7d32ad7602310da5c8cc0f0258fec2c Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 24 Nov 2024 13:15:02 -0600 Subject: [PATCH 3/3] assorted other changes (reducing runtime budgets) (20.5s => 18.3s) --- test/runtests.jl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1181176e..8bc8180b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,15 +21,15 @@ using Random: rand! @testset "passing value into setup" begin x = rand(100) - @b sort(x) - @b x sort # This was previously broken - @b rand hash + @b sort(x) seconds=.01 + @b x sort seconds=.01# This was previously broken + @b rand hash seconds=.01 x = rand - @b x hash + @b x hash seconds=.01 end @testset "blank space" begin - @test (@b sleep(.01) identity).time < .01 < (@b _ sleep(.01) identity).time + @test (@b sleep(.005) identity seconds=.01).time < .005 < (@b _ sleep(.005) identity seconds=.01).time end @testset "Median" begin @@ -158,23 +158,24 @@ using Random: rand! @test Chairmarks.DEFAULTS.gc === true Chairmarks.DEFAULTS.seconds = 1 @test Chairmarks.DEFAULTS.seconds === 1.0 - @test 1 <= @elapsed @b 1+1 + Chairmarks.DEFAULTS.seconds = 0.3 + @test 0.3 <= @elapsed @b 1+1 Chairmarks.DEFAULTS.seconds = 0.1 @test Chairmarks.DEFAULTS.seconds === 0.1 end @testset "Comparative benchmarking" begin # Basic - x,y = @b .001 sleep,sleep(10*_) + x,y = @b .0001 sleep,sleep(10*_) seconds=.01 @test x.evals == y.evals @test x.warmup == y.warmup - x,y = @be .001 sleep,sleep(10*_) + x,y = @be .0001 sleep,sleep(10*_) seconds=.01 @test length(x.samples) == length(y.samples) # Low sample count @b rand,hash(rand()) samples=0 evals=1 @b rand,hash(rand()) seconds=0 - @b rand,sleep(.2) + @b rand,sleep(.02) seconds=.01 # Full pipeline and order of evals log = [] @@ -182,7 +183,7 @@ using Random: rand! x,y = @be _push!(log, (0,)) _push!(log, (_...,1)) _push!(log, (_...,2)), _push!(log, (_...,3)) _push!(log, (_...,4)) seconds=.001 # Sanity - all(∈(((0,), (0,1), (0,1,2), (0,1,3), (0,1,2,4), (0,1,3,4))), log) + all(∈([(0,), (0,1), (0,1,2), (0,1,3), (0,1,2,4), (0,1,3,4)]), log) evals = Chairmarks.only(unique(x.evals for x in x.samples)) @test Chairmarks.only(unique(y.evals for y in y.samples)) == evals @@ -247,7 +248,7 @@ using Random: rand! glog = UInt[] f(x) = (@assert !issorted(x); push!(flog, hash(x)); sort!(x; alg=QuickSort)) g(x) = (@assert !issorted(x); push!(glog, hash(x)); sort!(x; alg=InsertionSort)) - @b rand!(a),copyto!(b,a) f(_[1]),g(_[2]) (@assert issorted(_::Vector{Int})) evals=1 + @b rand!(a),copyto!(b,a) f(_[1]),g(_[2]) (@assert issorted(_::Vector{Int})) evals=1 seconds=.01 @test flog == glog # More than two test functions