JuliaGeometry / GeometryBasics.jl

Basic Geometry Types
MIT License
165 stars 54 forks source link

Get rid of StaticArrays #169

Open SimonDanisch opened 2 years ago

SimonDanisch commented 2 years ago

And some other type clean ups.

sjkelly commented 2 years ago

This doesn't seem like the correct long term solution if we can cache precompiles between modules in 1.8+.

Xref discussion from a while back: https://github.com/JuliaGeometry/GeometryBasics.jl/issues/91

SimonDanisch commented 2 years ago

if we can cache precompiles between modules in 1.8+.

That's not helping, since StaticArrays emits much harder code to compile...So until we cache binary, this is a valid approach. I'm keeping the interface mainly the same, and this also helps remove complex code to wade through while optimizing Makie's compile times - while still allowing us to switch back to using StaticArrays once it makes sense.

Benchmarks indicating the utility of this PR are done with Julia already caching between modules. Since the new code is much less complicated it does indeed shave off around 1-3s.

See: https://github.com/JuliaPlots/Makie.jl/pull/1701 But yes, this opens up the discussion from https://github.com/JuliaGeometry/GeometryBasics.jl/issues/91. Since I'm touching all the Vec code, I'm willing to overthink the Vec/Point interface :)

sjkelly commented 2 years ago

This does share some time off Plots also:

julia> @time using Plots
  3.701392 seconds (6.20 M allocations: 496.627 MiB, 4.59% gc time, 21.38% compilation time)
julia> @time using Plots
  3.452578 seconds (6.12 M allocations: 487.336 MiB, 4.05% gc time, 22.26% compilation time)