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

Do less copies of Observables in Attributes + plot pipeline #2443

Merged
merged 4 commits into from Dec 6, 2022

Conversation

SimonDanisch
Copy link
Member

@SimonDanisch SimonDanisch commented Nov 25, 2022

While debugging how to update the array for xmax in #2446, i noticed we copy the Observable at least 3 times, making xmax.val = [...] not work, since the copied observables will still hold the old value.
So this should also cut down on observables, which in theory should make updates and creation a bit faster.

@MakieBot
Copy link
Collaborator

MakieBot commented Nov 25, 2022

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(display(fig))
using create display create display
GLMakie 30.34s (30.06, 31.01) 0.34+- 16.51s (16.10, 17.18) 0.35+- 15.52s (15.13, 16.20) 0.37+- 11.31ms (11.14, 11.56) 0.15+- 129.22ms (127.95, 132.99) 1.84+-
master 29.65s (29.46, 29.98) 0.19+- 16.45s (16.11, 17.24) 0.41+- 15.47s (15.32, 15.73) 0.17+- 13.91ms (13.72, 14.14) 0.13+- 131.22ms (130.03, 132.66) 1.00+-
evaluation +2.27%, 0.69s slower X (2.53d, 0.00p, 0.26std) +0.38%, 0.06s invariant (0.17d, 0.76p, 0.38std) +0.31%, 0.05s invariant (0.17d, 0.76p, 0.27std) -22.98%, -2.6ms faster✅ (-18.63d, 0.00p, 0.14std) -1.55%, -2.0ms faster ✓ (-1.36d, 0.03p, 1.42std)
CairoMakie 28.29s (27.96, 28.57) 0.22+- 18.00s (17.79, 18.25) 0.16+- 2.57s (2.52, 2.63) 0.04+- 11.57ms (11.26, 11.91) 0.23+- 4.94ms (4.78, 5.06) 0.10+-
master 27.42s (26.96, 27.76) 0.30+- 17.99s (17.68, 18.31) 0.24+- 2.56s (2.51, 2.63) 0.04+- 14.20ms (14.08, 14.35) 0.09+- 4.70ms (4.60, 4.80) 0.07+-
evaluation +3.10%, 0.88s slower X (3.29d, 0.00p, 0.26std) +0.06%, 0.01s invariant (0.06d, 0.92p, 0.20std) +0.18%, 0.0s invariant (0.12d, 0.83p, 0.04std) -22.72%, -2.63ms faster✅ (-15.17d, 0.00p, 0.16std) +4.87%, 0.24ms slower X (2.72d, 0.00p, 0.09std)
WGLMakie 34.70s (34.22, 35.06) 0.27+- 27.00s (26.60, 27.29) 0.20+- 45.84s (43.48, 56.97) 4.93+- 15.14ms (14.73, 15.59) 0.31+- 1.93s (1.90, 1.96) 0.03+-
master 34.27s (34.06, 34.47) 0.15+- 26.86s (26.59, 27.22) 0.22+- 47.42s (43.42, 68.20) 9.17+- 18.83ms (18.28, 19.14) 0.31+- 1.72s (1.70, 1.76) 0.02+-
evaluation +1.24%, 0.43s slower X (1.97d, 0.00p, 0.21std) +0.53%, 0.14s invariant (0.68d, 0.23p, 0.21std) -3.46%, -1.58s invariant (-0.22d, 0.70p, 7.05std) -24.38%, -3.69ms faster✅ (-11.81d, 0.00p, 0.31std) +10.71%, 0.21s slower❌ (8.74d, 0.00p, 0.02std)

@SimonDanisch SimonDanisch changed the title fix hvlines & do less copies of Observables Do less copies of Observables in Attributes + plot pipeline Nov 25, 2022
@SimonDanisch SimonDanisch merged commit 5de2b6b into master Dec 6, 2022
@SimonDanisch SimonDanisch deleted the sd/fix-hvlines branch December 6, 2022 14:34
@jkrumbiegel jkrumbiegel mentioned this pull request Dec 27, 2022
t-bltg pushed a commit to t-bltg/Makie.jl that referenced this pull request Dec 31, 2022
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.

None yet

2 participants