Speed up Image.point() and Image.point_transform()#9743
Open
akx wants to merge 3 commits into
Open
Conversation
Image.point()Image.point() and Image.point_transform()
Merging this PR will improve performance by 35.95%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_point_transform[1024x1024-I] |
10.1 ms | 5.2 ms | +93.63% |
| ⚡ | test_point_transform[1024x1024-F] |
7.6 ms | 5.2 ms | +46.96% |
| ⚡ | test_point_lut[1024x1024-L] |
4.9 ms | 3.7 ms | +31.84% |
| ⚡ | test_point_lut[1024x1024-RGBA] |
15.1 ms | 12.3 ms | +22.04% |
| ⚡ | test_point_lut[1024x1024-RGB] |
13.3 ms | 11.1 ms | +19.2% |
| ⚡ | test_point_lut[1024x1024-LA] |
11.4 ms | 9.9 ms | +15.67% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing akx:faster-point (81444fe) with main (6590b1b)
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.
Refs #9649, #9675, #9736, #9737, #9738, #9739, #9740 (same series, same techniques).
Cf. the aforementioned PRs, this also does a couple other cleanups for performance; on my machine, using ImagingNewDirty gave another +10% on top of the first commit. The last commit would technically allow a compiler to inline the
pointfunctions, but given their size, a compiler probably won't.