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

Even faster series adding #4235

Merged
merged 4 commits into from
Jun 14, 2022

Conversation

BioTurboNick
Copy link
Member

@BioTurboNick BioTurboNick commented Jun 11, 2022

This eliminates the last bit of unnecessary churn in the clims updating code.

Previous work ensured the updates only occur at series addition or other parameter change, rather than every time they need to be read.

This work ensures the other series are only updated if a new series would change the existing color limits.

Currently my US county plot takes 1.569 s (12306720 allocations: 342.66 MiB)

With this PR: 553.153 ms (2647060 allocations: 121.55 MiB)

FINALLY,

The profiler bottleneck is no longer colorbar updates, but is now something in argument processing:

Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
  ╎330 @Base\task.jl:482; (::VSCodeServer.var"#60#61")()
  ╎ 330 @VSCodeServer\src\eval.jl:34; macro expansion
  ╎  330 @Base\essentials.jl:726; invokelatest(::Any)
  ╎   330 @Base\essentials.jl:729; #invokelatest#2
  ╎    330 @VSCodeServer\src\repl.jl:124; (::VSCodeServer.var"#77#79"{Module, Expr, REPL.LineEdit...
  ╎     330 @Base\logging.jl:623; with_logger
  ╎    ╎ 330 @Base\logging.jl:511; with_logstate(f::Function, logstate::Any)
  ╎    ╎  330 @VSCodeServer\src\repl.jl:123; (::VSCodeServer.var"#78#80"{Module, Expr, REPL.LineEdi...
  ╎    ╎   330 @VSCodeServer\src\repl.jl:157; repleval(m::Module, code::Expr, #unused#::String)
  ╎    ╎    330 @Base\Base.jl:65; eval
  ╎    ╎     330 @Base\boot.jl:368; eval
  ╎    ╎    ╎ 330 @Plots\src\plot.jl:82; (::RecipesBase.var"#plot##kw")(::NamedTuple{(:fillco...
  ╎    ╎    ╎  330 @Plots\src\plot.jl:91; #plot#143
  ╎    ╎    ╎   330 @Plots\src\plot.jl:208; _plot!(plt::Plots.Plot, plotattributes::Any, args:...
  ╎    ╎    ╎    284 ...sPipeline\src\RecipesPipeline.jl:97; recipe_pipeline!(plt::Any, plotattributes::Any, ar...        
  ╎    ╎    ╎     277 ...pesPipeline\src\series_recipe.jl:27; _process_seriesrecipes!(plt::Any, kw_list::Any)
  ╎    ╎    ╎    ╎ 275 ...esPipeline\src\series_recipe.jl:46; _process_seriesrecipe(plt::Any, plotattributes::Any)        
  ╎    ╎    ╎    ╎  61  @Plots\src\pipeline.jl:351; add_series!(plt::Plots.Plot{Plots.GRBackend}, pl...
  ╎    ╎    ╎    ╎   55  @Plots\src\pipeline.jl:376; _prepare_subplot(plt::Plots.Plot{Plots.GRBacken...
  ╎    ╎    ╎    ╎  134 @Plots\src\pipeline.jl:366; add_series!(plt::Plots.Plot{Plots.GRBackend}, pl...
  ╎    ╎    ╎    ╎   108 @Plots\src\args.jl:2164; _update_series_attributes!(plotattributes::Rec...
 2╎    ╎    ╎    ╎    100 @Plots\src\args.jl:2250; _series_index(plotattributes::RecipesPipeline....
 2╎    ╎    ╎    ╎     98  @Plots\src\args.jl:1897; getindex
  ╎    ╎    ╎    ╎    ╎ 77  @RecipesPipeline\src\utils.jl:18; getindex(dd::RecipesPipeline.DefaultsDict, k::...
  ╎    ╎    ╎    ╎    ╎  71  @Base\dict.jl:569; haskey
  ╎    ╎    ╎    ╎    ╎   51  @Base\dict.jl:283; ht_keyindex
51╎    ╎    ╎    ╎    ╎    51  @Base\Base.jl:38; getproperty
  ╎    ╎    ╎    ╎  59  @Plots\src\pipeline.jl:367; add_series!(plt::Plots.Plot{Plots.GRBackend}, pl...

@codecov
Copy link

codecov bot commented Jun 11, 2022

Codecov Report

Merging #4235 (7e7147d) into master (6266ff8) will decrease coverage by 0.00%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##           master    #4235      +/-   ##
==========================================
- Coverage   77.93%   77.92%   -0.01%     
==========================================
  Files          28       28              
  Lines        7101     7112      +11     
==========================================
+ Hits         5534     5542       +8     
- Misses       1567     1570       +3     
Impacted Files Coverage Δ
src/colorbars.jl 86.56% <90.00%> (-2.91%) ⬇️
src/pipeline.jl 93.54% <100.00%> (ø)
src/backends/gr.jl 89.02% <0.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6266ff8...7e7147d. Read the comment docs.

@BioTurboNick
Copy link
Member Author

Might also really cut down on the hangs that can occur when you accidentally plot 1000s of series because the array wasn't in the right orientation.

@BioTurboNick BioTurboNick changed the title Even faster colorbar updating Even faster series adding Jun 12, 2022
@BeastyBlacksmith BeastyBlacksmith merged commit e39856e into JuliaPlots:master Jun 14, 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