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

Slow and excessive allocation in density and xticks #4608

Open
Moelf opened this issue Nov 20, 2024 · 0 comments
Open

Slow and excessive allocation in density and xticks #4608

Moelf opened this issue Nov 20, 2024 · 0 comments
Labels

Comments

@Moelf
Copy link
Contributor

Moelf commented Nov 20, 2024

using CairoMakie

@time begin
    fig = Figure(size=(800, 400))
    ax = Axis(fig[1,1]; title="inclusive", 
        # xticks=0:50:500,
        yscale=log10)
    barplot!(ax, 50:50:200, fill(15, 4))
    density!(ax, [-1e9];color = (:blue, 0.1), strokecolor = :darkblue, strokewidth = 0.7, label="MC Combination")
    display(fig)
end
#  0.106324 seconds (119.25 k allocations: 15.332 MiB)


@time begin
    fig = Figure(size=(800, 400))
    ax = Axis(fig[1,1]; title="inclusive", 
        xticks=0:50:500,
        yscale=log10)
    barplot!(ax, 50:50:200, fill(15, 4))
    density!(ax, [-1e9];color = (:blue, 0.1), strokecolor = :darkblue, strokewidth = 0.7, label="MC Combination")
    display(fig)
end
# 5.600610 seconds (78.40 k allocations: 11.603 GiB, 12.51% gc time)

cc. @sfranchel this means we shouldn't use the density!() to "fake" a legend element...

@Moelf Moelf added the bug label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant