JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia
http://juliamath.github.io/Interpolations.jl/
Other
523 stars 110 forks source link

switch from StaticArrays to StaticArraysCore #526

Closed sjkelly closed 9 months ago

sjkelly commented 1 year ago

This package primarily uses the SVector as a return type, instead of using the operations on said SVector. Therefore StaticArraysCore provides immense improvements to loads time:

before:

julia> @time using Interpolations
  1.171881 seconds (2.33 M allocations: 172.010 MiB, 2.03% compilation time: 8% of which was recompilation)

after:

julia> @time using Interpolations
  0.312613 seconds (387.59 k allocations: 28.954 MiB, 7.65% compilation time: 9% of which was recompilation)

I would argue though that an NTuple would be sufficent return type in most cases. Though that is a breaking change and can remain an idea for a major release.

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4b617f6) 87.85% compared to head (b412a30) 87.17%. Report is 3 commits behind head on master.

:exclamation: Current head b412a30 differs from pull request most recent head dedab7a. Consider uploading reports for the commit dedab7a to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #526 +/- ## ========================================== - Coverage 87.85% 87.17% -0.69% ========================================== Files 28 28 Lines 1878 1856 -22 ========================================== - Hits 1650 1618 -32 - Misses 228 238 +10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sjkelly commented 1 year ago

Okay I realize while fixing the docs builds that StaticArraysCore removed some constructors and converts. There are some holes in coverage that we will need to plug to make sure that all calls to SVector are okay.

mkitti commented 1 year ago

We should revisit this.

aplavin commented 1 year ago

Does Interpolations only return static arrays when static arrays collections are passed as arguments?

If yes: the new Julia 1.9 feature "package extensions" can be used to use StaticArrays only when they are already loaded by the user.

If no: when else does it return static arrays? Maybe these cases could be removed?

mkitti commented 1 year ago

We may be using it internally as well. I'll have to double check.

mkitti commented 9 months ago

I think this is a good idea, but this is going to need more refactoring for it to work.