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

Improve CairoMakie performance #1981

Merged
merged 11 commits into from
May 26, 2022
Merged

Improve CairoMakie performance #1981

merged 11 commits into from
May 26, 2022

Conversation

jkrumbiegel
Copy link
Member

@jkrumbiegel jkrumbiegel commented May 26, 2022

  • type stability improvements for scatter
  • make draw_pattern type stable
  • calculate z only once per face
  • reduce allocations in draw_pattern
  • avoid sizedvector for fewer allocations
  • revert accidental scatter marker change
  • use cached extent
  • avoid SizedVector
  • move marker conversion out of loop

Description

With this test code:

begin
    f = Figure()
    scatter(f[1, 1], range(0, 50, 100000), sin, marker = :utriangle)
    lines(f[1, 2], range(0, 50, 100000), sin)
    surface(f[2, 1], range(0, 2pi, length = 200), range(0, 2pi, length = 200), cosi,
        axis = (type = Axis3,)
    )
    heatmap(f[2, 2], (1:300).^1.2, 1:300, randn(300, 300))
    @time display(f)
end

Master: 5.075926 seconds (55.47 M allocations: 1.585 GiB, 6.78% gc time)
This PR: 0.742038 seconds (2.58 M allocations: 114.594 MiB)

@MakieBot
Copy link
Collaborator

MakieBot commented May 26, 2022

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt.

using time

master:  10.28 < 10.37 > 10.43, 0.05+-
pr:      10.35 < 10.44 > 10.47, 0.04+-
speedup: 0.98 < 1.00 > 1.00, 0.01+-
median:  +0.62% => invariant

This PR does not change the using time.

ttfp time

master   26.31 < 26.43 > 26.64, 0.14+-
pr       26.30 < 26.34 > 26.43, 0.05+-
speedup: 1.00 < 1.00 > 1.01, 0.00+-
median:  -0.34% => invariant

This PR does not change the ttfp time.

@jkrumbiegel jkrumbiegel merged commit 3a23d6b into master May 26, 2022
@jkrumbiegel jkrumbiegel deleted the jk/performance branch May 26, 2022 15:18
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