Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resample Optimization #5456

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

danieldresser-ie
Copy link
Contributor

Minor optimization of Resample, fixing cases where we were traversing more pixels than necessary, and while I'm at it, pulling the calls to floor/ceil out of the inner loop.

Performance results are:

- testPerfInseparableAwkwardSize (GafferImageTest.ResampleTest.ResampleTest) : was 2.00s now 0.74s (63% reduction)
- testPerfInseparableDisk (GafferImageTest.ResampleTest.ResampleTest) : was 6.31s now 5.92s (6% reduction)
- testPerfInseparableLanczos (GafferImageTest.ResampleTest.ResampleTest) : was 15.16s now 14.44s (5% reduction)
- testPerfSmallFilter (GafferImageTest.ResampleTest.ResampleTest) : was 0.43s now 0.39s (8% reduction)
- testPerfVerySmallFilter (GafferImageTest.ResampleTest.ResampleTest) : was 0.39s now 0.36s (10% reduction)

Also, now that a box filter just samples the values it uses, rather than also taking adjacent pixels and multiplying them by zero, it no longer converts inf to NaN, so we can remove the workaround from MergeTest.

@danieldresser-ie danieldresser-ie changed the base branch from main to 1.3_maintenance September 5, 2023 22:55
@johnhaddon
Copy link
Member

LGTM. I've pushed a rebase just to fix the conflicts in Changes.md - everything else is the same. Merging.

@johnhaddon johnhaddon merged commit dbe3700 into GafferHQ:1.3_maintenance Sep 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants