JuliaGeometry / Contour.jl

Calculating contour curves for 2D scalar fields in Julia
Other
43 stars 13 forks source link

Make interface generic, Drop StaticArrays as hard dependency #68

Closed sjkelly closed 2 years ago

sjkelly commented 2 years ago

This package really doesn't need StaticArrays for functionality. By removing it we greatly improve load times and also make the interface more generic, allowing arbitrary support for any StaticVector-like constructor.

before:

julia> @time using Contour
  0.842599 seconds (2.50 M allocations: 187.757 MiB, 0.37% compilation time)

after:

julia> @time using Contour
  0.020156 seconds (2.95 k allocations: 271.500 KiB, 31.36% compilation time)`

Coupled with and this and https://github.com/JuliaGeometry/GeometryBasics.jl/pull/169 , we make loading Plots almost 10% faster:

before: 
julia> @time using Plots
  5.908080 seconds (8.87 M allocations: 655.109 MiB, 7.27% gc time, 25.84% compilation time)

julia> @time using Plots
  5.541558 seconds (8.62 M allocations: 618.985 MiB, 6.66% gc time, 22.87% compilation time)
sjkelly commented 2 years ago

I am not 100% this is the API we want yet, but it is a step in the right direction for a point release.