Add FastInterpolations as a faster resampling backend - #5706
Open
mgyoo86 wants to merge 5 commits into
Open
Conversation
Resampler and its Pyramid payload now build interpolants with FastInterpolations (LinearInterp) instead of Interpolations (Linear). Passing an Interpolations degree still selects the old path, so the change is additive; output matches the previous linear result to floating-point round-off (Resampler ~1 ulp, Pyramid bit-identical). The curvilinear contourf remap also uses FastInterpolations now (internal, identical output).
Author
|
For the maintainers' information: |
Collaborator
|
/benchmark 30 Oh, nvm, benchmarks don't work with branches on forks. I wanted to check if this influences using time, just in case |
…resampler-fastinterpolations-backend
Author
|
For maintainters' information: @ffreyer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I'm the author of FastInterpolations.jl, a new high-performance interpolation package, and I'm looking for more places to use it.
I found that
Resampler(and itsPyramidpayload) looks like a nice fit; it resamples on every pan/zoom, so faster interpolation helps interactivity.This PR adds a small, shallow wrapper so
Resampler(and itsPyramidpayload) can use theFastInterpolationsAPI through the existingmethod/modekeyword.In the real per-frame resampling path, FastInterpolations is 2–9× faster than
Interpolations.jland matches the current output to floating-point round-off. So I madeFastInterpolations.LinearInterp()the default; anything that already usedInterpolationsdirectly keeps working, and reverting the default is a one-line change.In addition, the curvilinear
contourfremap now also uses FastInterpolations — internal only, with identical output.Benchmarks
Interpolations.jl's
Linear()vs. the new default FastInterpolations.jl'sLinearInterp(), measured through the realresample_image(the per-frame function):a (2000x2000) source, either a
Float32field and anRGB{N0f8}photo-like image, downsampled to (500x500) for display.Float32RGB{N0f8}Float32RGB{N0f8}The following is a benchmark script for the table above:
This PR needs FastInterpolations 0.4.16, pinned in
[compat].Thanks for taking a look, any feedbacks and thoughts are welcome!