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

clean up some more observables for blocks and axis #3475

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

SimonDanisch
Copy link
Member

Improves test case:

using GLMakie

limits = Observable((-1.0, 1.0, -1.0, 1.0))

for _ in 1:5
    fig = Figure()
    for i in 1:5
        for j in 1:5
            ax = Axis(fig[i, j]; limits)
        end
    end
    empty!(fig)
end
GC.gc(true)@
@test isempty(limits.listeners) 

But still doesn't clean up if empty! is replaced by display(fig).

@MakieBot
Copy link
Collaborator

MakieBot commented Dec 15, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(fig)
using create display create display
GLMakie 3.49s (3.47, 3.51) 0.02+- 397.09ms (388.36, 401.36) 5.11+- 469.69ms (466.26, 475.99) 3.30+- 7.18ms (7.11, 7.22) 0.04+- 25.31ms (25.26, 25.38) 0.04+-
master 3.50s (3.49, 3.51) 0.01+- 363.31ms (304.72, 389.43) 38.44+- 474.47ms (463.83, 510.42) 16.27+- 7.18ms (7.11, 7.27) 0.06+- 25.29ms (25.25, 25.32) 0.02+-
evaluation 1.00x invariant, -0.01s (-1.06d, 0.08p, 0.01std) 0.91x noisy🤷‍♀️, 33.79ms (1.23d, 0.06p, 21.77std) 1.01x invariant, -4.77ms (-0.41d, 0.47p, 9.78std) 1.00x invariant, -0.0ms (-0.02d, 0.98p, 0.05std) 1.00x invariant, 0.02ms (0.51d, 0.36p, 0.03std)
CairoMakie 3.06s (3.02, 3.09) 0.02+- 318.11ms (314.65, 320.60) 2.36+- 142.58ms (140.83, 144.78) 1.58+- 7.16ms (7.07, 7.37) 0.10+- 596.95μs (593.98, 599.58) 2.35+-
master 3.07s (3.02, 3.10) 0.02+- 321.04ms (313.96, 329.04) 5.06+- 143.22ms (139.82, 151.30) 3.86+- 7.13ms (7.05, 7.23) 0.08+- 599.23μs (595.22, 603.92) 3.22+-
evaluation 1.00x invariant, -0.01s (-0.29d, 0.60p, 0.02std) 1.01x invariant, -2.93ms (-0.74d, 0.20p, 3.71std) 1.00x invariant, -0.64ms (-0.22d, 0.70p, 2.72std) 1.00x invariant, 0.03ms (0.31d, 0.57p, 0.09std) 1.00x invariant, -2.28μs (-0.81d, 0.16p, 2.79std)
WGLMakie 3.74s (3.72, 3.76) 0.02+- 318.67ms (311.96, 323.27) 3.77+- 8.59s (8.48, 8.63) 0.05+- 9.10ms (9.04, 9.17) 0.05+- 72.04ms (66.13, 80.92) 5.91+-
master 3.73s (3.70, 3.76) 0.02+- 317.61ms (313.38, 320.85) 2.95+- 8.55s (8.50, 8.59) 0.04+- 9.41ms (9.06, 11.06) 0.73+- 72.87ms (66.68, 81.51) 6.29+-
evaluation 1.00x invariant, 0.01s (0.43d, 0.44p, 0.02std) 1.00x invariant, 1.05ms (0.31d, 0.57p, 3.36std) 1.00x invariant, 0.04s (0.79d, 0.17p, 0.04std) 1.03x invariant, -0.32ms (-0.61d, 0.30p, 0.39std) 1.01x invariant, -0.83ms (-0.14d, 0.80p, 6.10std)

@SimonDanisch SimonDanisch merged commit 479d293 into master Dec 15, 2023
15 checks passed
@SimonDanisch SimonDanisch deleted the sd/axis-obs-cleanup branch December 15, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants