Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 1.11.0 test regression #376

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions test/tst_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.8 # ~ 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

Expand Down
Loading