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 redisplaying figures on same screen #3573

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

SimonDanisch
Copy link
Member

The following would retain previously scene objects:

using GLMakie
GLMakie.activate!(float=true)

screen = GLMakie.Screen(; size=(600, 450))

f1 = Figure()
Axis(f1[1, 1])
display(screen, f1)

sleep(3)

f2 = Figure()
Axis3(f2[1, 1])
display(screen, f2)

display(screen, Figure().scene)

This PR fixes it!

@MakieBot
Copy link
Collaborator

MakieBot commented Jan 29, 2024

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.44s (3.43, 3.47) 0.02+- 362.46ms (309.55, 387.01) 35.43+- 465.60ms (460.89, 470.90) 3.41+- 7.12ms (7.05, 7.17) 0.04+- 25.41ms (25.36, 25.47) 0.04+-
master 3.43s (3.41, 3.47) 0.02+- 390.07ms (384.32, 397.44) 5.58+- 474.11ms (465.02, 513.14) 17.28+- 7.12ms (7.01, 7.22) 0.07+- 25.42ms (25.33, 25.58) 0.08+-
evaluation 1.00x invariant, 0.01s (0.54d, 0.33p, 0.02std) 1.08x noisy🤷‍♀️, -27.61ms (-1.09d, 0.09p, 20.51std) 1.02x invariant, -8.51ms (-0.68d, 0.25p, 10.35std) 1.00x invariant, 0.0ms (0.04d, 0.94p, 0.06std) 1.00x invariant, -0.02ms (-0.25d, 0.66p, 0.06std)
CairoMakie 3.05s (3.03, 3.08) 0.02+- 322.01ms (317.61, 328.32) 4.07+- 141.11ms (139.05, 143.82) 1.78+- 7.26ms (7.19, 7.37) 0.06+- 602.87μs (597.09, 609.53) 3.92+-
master 3.08s (3.02, 3.26) 0.08+- 326.72ms (315.90, 356.12) 13.67+- 143.77ms (138.54, 153.98) 6.44+- 7.35ms (7.20, 7.54) 0.12+- 603.89μs (600.22, 609.61) 3.16+-
evaluation 1.01x invariant, -0.03s (-0.51d, 0.37p, 0.05std) 1.01x invariant, -4.71ms (-0.47d, 0.41p, 8.87std) 1.02x invariant, -2.65ms (-0.56d, 0.33p, 4.11std) 1.01x invariant, -0.09ms (-0.94d, 0.11p, 0.09std) 1.00x invariant, -1.02μs (-0.28d, 0.60p, 3.54std)
WGLMakie 3.91s (3.87, 3.95) 0.03+- 360.69ms (353.85, 370.44) 6.07+- 9.68s (9.60, 9.79) 0.07+- 10.59ms (9.72, 14.06) 1.54+- 69.59ms (68.92, 71.48) 0.88+-
master 3.93s (3.87, 3.97) 0.04+- 353.44ms (340.50, 362.35) 7.81+- 9.67s (9.50, 9.80) 0.10+- 9.96ms (9.71, 10.34) 0.23+- 69.88ms (68.42, 71.66) 1.09+-
evaluation 1.00x invariant, -0.01s (-0.40d, 0.47p, 0.03std) 0.98x invariant, 7.26ms (1.04d, 0.08p, 6.94std) 1.00x invariant, 0.01s (0.09d, 0.87p, 0.08std) 0.94x noisy🤷‍♀️, 0.63ms (0.57d, 0.32p, 0.88std) 1.00x invariant, -0.29ms (-0.29d, 0.59p, 0.98std)

@jkrumbiegel
Copy link
Member

can confirm that this fixed the mwe on my mac

@SimonDanisch SimonDanisch merged commit 6b7377b into master Jan 29, 2024
17 checks passed
@SimonDanisch SimonDanisch deleted the sd/fix-redisplay branch January 29, 2024 15:35
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.

3 participants