Open SBuercklin opened 1 year ago
The interpolator construction does look a bit unusual. Usually, one scales before applying the extrapolation.
The overall design of this package is meant to elide bounds checking to enable SIMD, so forcing bounds checking is going to create a major slowdown. That said I have not seen a slowdown of that magnitude.
Thanks for the tip on the scaling; I will make that change in our codebase.
We can get by with no bounds checking for deployment, so this isn't a showstopping issue for us. The only problem is we can't test a case where we need the 5D interpolation, but I can work on a reduced dimension test for our use case. Nevertheless, it would be nice if there were a way around this, but it sounds like that's a larger problem to solve with bounds-checking that's not specific to Interpolations.jl
I have a script which does some interpolations over a 5D grid.
When running the script below normally from the command line, it takes ~25 seconds on my machine, mostly compilation time. However, when I run it with
julia --bounds-check=yes
(or in the test suite, which is how I encountered into this problem), it takes nearly 12 minutes.For interactive/production usage the package currently works fine, but when using an interpolator in a test, performance drops dramatically. Can anything be done to improve performance when bounds checking is turned on?
Script to demonstrate: