Plots.jl icon indicating copy to clipboard operation
Plots.jl copied to clipboard

Remove GeometryBasics/StaticArrays

Open sjkelly opened this issue 1 year ago • 4 comments

I realize GeometryBasics is barely used here. It is a quite costly dependency, and is only used in a few places, where a simple Tuple seems to suffice. Removing it as a dependency completely removes the need for Plots to depend on StaticArrays, shaving a substantial amount of time off using:

Before:

  3.803301 seconds (8.99 M allocations: 601.643 MiB, 10.07% gc time, 20.31% compilation time)
elapsed time (ns): 3803300770
gc time (ns):      382894522
bytes allocated:   630868505
pool allocs:       8986011
non-pool GC allocs:1970
malloc() calls:    201
realloc() calls:   4
GC pauses:         7
full collections:  2

---

julia> @timev using Plots
  4.005920 seconds (8.99 M allocations: 602.993 MiB, 10.34% gc time, 21.30% compilation time)
elapsed time (ns): 4005919780
gc time (ns):      414263105
bytes allocated:   632284409
pool allocs:       8990504
non-pool GC allocs:2083
malloc() calls:    201
realloc() calls:   4
GC pauses:         6
full collections:  1

After:

  2.442962 seconds (5.31 M allocations: 341.848 MiB, 6.64% gc time, 32.28% compilation time)
elapsed time (ns): 2442961858
gc time (ns):      162169900
bytes allocated:   358453201
pool allocs:       5304483
non-pool GC allocs:1820
malloc() calls:    133
realloc() calls:   4
GC pauses:         6
full collections:  1

----

julia> @timev using Plots
  2.842176 seconds (5.31 M allocations: 342.093 MiB, 14.46% gc time, 27.25% compilation time)
elapsed time (ns): 2842176139
gc time (ns):      411022416
bytes allocated:   358710657
pool allocs:       5304476
non-pool GC allocs:1834
malloc() calls:    133
realloc() calls:   4
GC pauses:         6
full collections:  2

sjkelly avatar Jul 27 '22 01:07 sjkelly

Codecov Report

Base: 81.10% // Head: 80.85% // Decreases project coverage by -0.25% :warning:

Coverage data is based on head (acf2987) compared to base (1a95d8b). Patch coverage: 42.85% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4287      +/-   ##
==========================================
- Coverage   81.10%   80.85%   -0.26%     
==========================================
  Files          28       28              
  Lines        7324     7317       -7     
==========================================
- Hits         5940     5916      -24     
- Misses       1384     1401      +17     
Impacted Files Coverage Δ
src/Plots.jl 87.80% <ø> (ø)
src/examples.jl 98.46% <ø> (+1.53%) :arrow_up:
src/init.jl 100.00% <ø> (ø)
src/recipes.jl 65.79% <ø> (-1.56%) :arrow_down:
src/utils.jl 75.54% <ø> (-0.08%) :arrow_down:
src/components.jl 89.14% <42.85%> (-0.26%) :arrow_down:
src/consts.jl 75.00% <0.00%> (-25.00%) :arrow_down:
src/backends.jl 65.74% <0.00%> (-1.23%) :arrow_down:
src/backends/hdf5.jl 83.02% <0.00%> (-0.74%) :arrow_down:
... and 11 more

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

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

codecov[bot] avatar Jul 27 '22 19:07 codecov[bot]

Any reason why Benchmarks is failing? Is it caching a Manifest?

sjkelly avatar Jul 27 '22 19:07 sjkelly

Any reason why Benchmarks is failing? Is it caching a Manifest?

Seems it is looking for GeometryBasics for the run of the master version and can't find it, since it is not in the Project.toml anymore...

BeastyBlacksmith avatar Aug 09 '22 12:08 BeastyBlacksmith

I have not much time to look into BenchmarksCI more. I am wondering if this were merged it would then run okay?

sjkelly avatar Aug 09 '22 14:08 sjkelly

@BeastyBlacksmith thanks for looking at the BenchmarksCI!

sjkelly avatar Aug 23 '22 13:08 sjkelly

@BeastyBlacksmith thanks for looking at the BenchmarksCI!

Yeah, well.. this is a mess though. It ought to be easier...

BeastyBlacksmith avatar Aug 23 '22 15:08 BeastyBlacksmith

So benchmarks are green now. Not sure how to go about ci, looks kind of unrelated

BeastyBlacksmith avatar Aug 24 '22 12:08 BeastyBlacksmith

Amazing! It seems CI has been failing a few days now?

On Wed, Aug 24, 2022, 08:24 Simon Christ @.***> wrote:

So benchmarks are green now. Not sure how to go about ci, looks kind of unrelated

— Reply to this email directly, view it on GitHub https://github.com/JuliaPlots/Plots.jl/pull/4287#issuecomment-1225650524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP5MDCFETLVT2PQZ2R62CTV2YH7FANCNFSM54XZ5KBQ . You are receiving this because you authored the thread.Message ID: @.***>

sjkelly avatar Aug 24 '22 12:08 sjkelly

So benchmarks are green now.

Looking at the results though.. I question the fidelity of the benchmark

BeastyBlacksmith avatar Aug 24 '22 12:08 BeastyBlacksmith

Better now

BeastyBlacksmith avatar Aug 24 '22 14:08 BeastyBlacksmith

CI was fixed in https://github.com/JuliaPlots/Plots.jl/pull/4319.

I will merge this PR when ci is green (after merge of https://github.com/JuliaPlots/Plots.jl/pull/4320), since the ref images changed.

t-bltg avatar Sep 02 '22 07:09 t-bltg

I'd wait with merging until we checked whether we can keep existing functionality with StaticArraysCore (see https://github.com/JuliaPlots/Plots.jl/pull/4287#discussion_r931254890)

BeastyBlacksmith avatar Sep 02 '22 07:09 BeastyBlacksmith

Noted, postponed.

t-bltg avatar Sep 02 '22 08:09 t-bltg

StaticArraysCore does not cover that dispatch case I commented on. Any GeometryBasics and StaticArrays dep would end up in downstream plotting recipes packages instead. Though the StaticArraysCore dependency is cheap, it isn't going to help here.

sjkelly avatar Sep 02 '22 12:09 sjkelly

@BeastyBlacksmith, merge ?

t-bltg avatar Sep 02 '22 12:09 t-bltg

I have updated the docs here: https://github.com/JuliaPlots/PlotDocs.jl/pull/300

sjkelly avatar Sep 08 '22 15:09 sjkelly

:+1:

j-fu avatar Sep 13 '22 09:09 j-fu