Skip to content
Snippets Groups Projects
Commit b3a50337 authored by Julien Michel's avatar Julien Michel
Browse files

PERF: Optimize BCOInterpolateImageFunction (kindly provided by Laurentiu Nicola)

Simplify the code and avoid some allocations to improve performance.

I haven't checked the definition of RealType, but merging the output and
value variables might arguably affect precision. The unit tests still
seem to pass, however.

Tested by 2x upsampling a 10-band 5490x5490 float32 image on an Intel
Celeron J1900.

There is further room for improvement by eliding the remaining memory
allocations. A container like the small_vector from Boost might be
useful here, but we can't use that since it's not available in older
Boost versions.

before:
661.44s user 9.31s system 304% cpu 3:40.52 total
594.06s user 9.43s system 303% cpu 3:19.00 total
591.15s user 9.43s system 301% cpu 3:19.28 total

after:
443.42s user 10.48s system 294% cpu 2:34.00 total
443.11s user 9.87s system 309% cpu 2:26.27 total
448.50s user 10.50s system 311% cpu 2:27.52 total
parent 37b305f9
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment