-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Improve CairoMakie's 2D mesh performance #4132
Conversation
This also restores parity in the loop body with `draw_mesh3d`.
This shaves ~20% runtime from mesh2d
Compile Times benchmarkNote, 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)
|
Should we merge this since nothing more has happened here? 30% is already quite significant (and the GeometryBasics refactor may change some details anyway) |
Agreed, may as well merge. Will wait for the GeometryBasics refactor before pushing more on this! (And in the worst case, we can just switch all meshes to the 3d pipeline if it's significantly faster) |
WGLMakie failures are because the texture atlas is slightly larger than expected: session_size = 6.095909
texture_atlas_size = 6.095909
memory leaks: Test Failed at /home/runner/work/Makie.jl/Makie.jl/WGLMakie/test/runtests.jl:57
Expression: texture_atlas_size < 6
Evaluated: 6.095909 < 6
Stacktrace:
[1] macro expansion
@ ~/work/Makie.jl/Makie.jl/WGLMakie/test/runtests.jl:57 [inlined]
[2] macro expansion
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[3] top-level scope
@ ~/work/Makie.jl/Makie.jl/WGLMakie/test/runtests.jl:43
Test Summary: | Pass Fail Total
memory leaks | 3 1 4
ERROR: LoadError: Some tests did not pass: 3 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/runner/work/Makie.jl/Makie.jl/WGLMakie/test/runtests.jl:42
ERROR: Package WGLMakie errored during testing
Stacktrace: |
Description
As seen in #4112, CairoMakie's 2D drawing routines are pretty slow. This PR attempts to speed them up a bit (currently has a ~30% improvement locally). Not done with the optimization or profiling yet though, and I have a sense that a lot of optimization is still doable.
Each change is usually a single commit so the commit log should show what's been done.
Type of change