Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Merging this PR will improve performance by ×4.1
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_rank_filter[1237x811-L-Min3] |
242 ms | 10.7 ms | ×23 |
| ⚡ | test_rank_filter[1237x811-F-Min3] |
252 ms | 29.6 ms | ×8.5 |
| ⚡ | test_rank_filter[1237x811-I-Min3] |
264.5 ms | 33.4 ms | ×7.9 |
| ⚡ | test_rank_filter[1237x811-F-Median3] |
275.9 ms | 55 ms | ×5 |
| ⚡ | test_rank_filter[1237x811-L-Median3] |
244.4 ms | 57.1 ms | ×4.3 |
| ⚡ | test_rank_filter[1237x811-I-Median3] |
268.2 ms | 69.6 ms | ×3.9 |
| ⚡ | test_rank_filter[1237x811-F-Median5] |
566.1 ms | 344.8 ms | +64.18% |
| ⚡ | test_rank_filter[1237x811-L-Median5] |
476.3 ms | 366.5 ms | +29.96% |
| ⚡ | test_rank_filter[1237x811-I-Median5] |
527.3 ms | 421 ms | +25.25% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing akx:top-ranking (a84857d) with main (ad277e2)
Footnotes
-
338 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Contributor
Author
|
The min/max speedup isn't as drastic on Codspeed - I presume GCC isn't optimizing that well. |
This removes the `IMAGING_PIXEL_(type)` macros from `Imaging.h` too; they were only used in `RankFilter.c` and in one place in `_imaging.c`.
This branch has not been deployed
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.
Tangentially refs #10041 (but doesn't include that GIL release).
This PR:
ImagingExpand(which underpinsRankFilter), and makes it correct for 16-bpc dataRankFilter.c.IMAGING_PIXEL_<dtype>macros from_imaging.h. They were only used inRankFilter(which no longer does image row pointer acquisition for every pixel) and in 2 places in_imaging.c.On my machine, this shows a rather shocking speedup for the common benchmarked cases:
Adding support for
I;16images inRankFilteris a small patch on top of it if it's desired, but it felt out of scope for this PR.