From 3c323a0f0cdff97ef462711f8db279ac6e79851e Mon Sep 17 00:00:00 2001 From: t-bltg Date: Tue, 26 Mar 2024 11:34:41 +0100 Subject: [PATCH 1/3] fix `1.11.0` test regression --- test/tst_io.jl | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/test/tst_io.jl b/test/tst_io.jl index 79ae3d17..a91cc0e8 100644 --- a/test/tst_io.jl +++ b/test/tst_io.jl @@ -56,30 +56,34 @@ end end end -@testset "stringify plot - performance regression" begin - p = heatmap(collect(1:30) * collect(1:30)') - @test string(p; color = true) isa String # 1st pass - ttfp - - measure = Sys.islinux() && VERSION > v"1.10.0" && length(VERSION.prerelease) < 2 +sombrero(x, y) = 30sinc(√(x^2 + y^2) / π) - if measure - GC.enable(false) - stats = @timed string(p; color = true) # repeated ! - @test stats.bytes / 1e3 < 400 # ~ 356kB on 1.10 - @test stats.time * 1e3 < 0.5 # ~ 0.3ms on 1.10 - GC.enable(true) +@testset "stringify plot - performance regression" begin + nightly = occursin("DEV", string(VERSION)) # or length(VERSION.prerelease) < 2 + measure = Sys.islinux() && VERSION > v"1.10.0-" && !nightly + + let p = heatmap(collect(1:30) * collect(1:30)') + @test string(p; color = true) isa String # 1st pass - ttfp + + if measure + GC.enable(false) + stats = @timed string(p; color = true) # repeated ! + @test stats.bytes / 1e3 < 500 # ~ 356kB on 1.10 + @test stats.time * 1e3 < 0.6 # ~ 0.3ms on 1.10 + GC.enable(true) + end end - sombrero(x, y) = 30sinc(√(x^2 + y^2) / π) - p = surfaceplot(-8:0.5:8, -8:0.5:8, sombrero; axes3d = false) - @test string(p; color = true) isa String # 1st pass - ttfp + let p = surfaceplot(-8:0.5:8, -8:0.5:8, sombrero; axes3d = false) + @test string(p; color = true) isa String # 1st pass - ttfp - if measure - GC.enable(false) - stats = @timed string(p; color = true) # repeated ! - @test stats.bytes / 1e3 < 160 # ~ 152kB on 1.10 - @test stats.time * 1e3 < 0.5 # ~ 0.26ms on 1.10 - GC.enable(true) + if measure + GC.enable(false) + stats = @timed string(p; color = true) # repeated ! + @test stats.bytes / 1e3 < 160 # ~ 152kB on 1.10 + @test stats.time * 1e3 < 0.5 # ~ 0.26ms on 1.10 + GC.enable(true) + end end end From 22225bc5a03a75f8ee2528a3ad6099150516d317 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Tue, 26 Mar 2024 11:40:39 +0100 Subject: [PATCH 2/3] relax test tolerance --- test/tst_io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tst_io.jl b/test/tst_io.jl index a91cc0e8..fca72cd7 100644 --- a/test/tst_io.jl +++ b/test/tst_io.jl @@ -69,7 +69,7 @@ sombrero(x, y) = 30sinc(√(x^2 + y^2) / π) GC.enable(false) stats = @timed string(p; color = true) # repeated ! @test stats.bytes / 1e3 < 500 # ~ 356kB on 1.10 - @test stats.time * 1e3 < 0.6 # ~ 0.3ms on 1.10 + @test stats.time * 1e3 < 0.7 # ~ 0.3ms on 1.10 GC.enable(true) end end From ec9a834b73f3b902e48eacf590f9545b3727e89b Mon Sep 17 00:00:00 2001 From: t-bltg Date: Tue, 26 Mar 2024 11:46:47 +0100 Subject: [PATCH 3/3] relax tolerance --- test/tst_io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tst_io.jl b/test/tst_io.jl index fca72cd7..3afd3113 100644 --- a/test/tst_io.jl +++ b/test/tst_io.jl @@ -69,7 +69,7 @@ sombrero(x, y) = 30sinc(√(x^2 + y^2) / π) GC.enable(false) stats = @timed string(p; color = true) # repeated ! @test stats.bytes / 1e3 < 500 # ~ 356kB on 1.10 - @test stats.time * 1e3 < 0.7 # ~ 0.3ms on 1.10 + @test stats.time * 1e3 < 0.8 # ~ 0.3ms on 1.10 GC.enable(true) end end