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

add empty! for Plots and Subplots #4543

Merged
merged 1 commit into from Nov 23, 2022
Merged

add empty! for Plots and Subplots #4543

merged 1 commit into from Nov 23, 2022

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Nov 23, 2022

using BenchmarkTools, Plots

const mat = randn(512, 512)

f(x, n) = begin
  pl = plot()
  for _ in 1:n
      empty!(pl)  # clear out previous series
      heatmap!(x)
  end
  pl
end

@time display(f(mat, 100))  # warmup

@time display(f(mat, 100))
 1.255724 seconds (3.20 M allocations: 374.080 MiB, 19.67% gc time)  # PR
 32.482719 seconds (314.77 M allocations: 16.524 GiB, 8.18% gc time)  # master (without `empty!`, obviously)

@t-bltg t-bltg added the performance speedups and slowdowns label Nov 23, 2022
@t-bltg t-bltg force-pushed the empty branch 3 times, most recently from d3d7b27 to f0f4727 Compare November 23, 2022 14:44
@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 90.88% // Head: 90.89% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (384f4d7) compared to base (eb99990).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4543   +/-   ##
=======================================
  Coverage   90.88%   90.89%           
=======================================
  Files          40       40           
  Lines        7705     7707    +2     
=======================================
+ Hits         7003     7005    +2     
  Misses        702      702           
Impacted Files Coverage Δ
src/types.jl 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@t-bltg t-bltg merged commit 8cec880 into JuliaPlots:master Nov 23, 2022
@t-bltg t-bltg deleted the empty branch November 23, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance speedups and slowdowns
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant