FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Speed up `Image.point()` and `Image.point_transform()` by akx · Pull Request #9743 · python-pillow/Pillow · GitHub

Speed up Image.point() and Image.point_transform() - #9743

Open
akx wants to merge 4 commits into
python-pillow:mainfrom
akx:faster-point
Open

Speed up Image.point() and Image.point_transform()#9743
akx wants to merge 4 commits into
python-pillow:mainfrom
akx:faster-point

Conversation

akx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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 point functions, but given their size, a compiler probably won't.

akx changed the title Speed up Image.point() Speed up Image.point() and Image.point_transform() Jun 30, 2026

codspeed-hq Bot commented Jun 30, 2026
edited
Loading

Copy link
Copy Markdown

Merging this PR will improve performance by 31.23%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 8 improved benchmarks
✅ 547 untouched benchmarks
⏩ 335 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
test_point_transform[1237x811-I] 9.7 ms 5 ms +93.38%
test_point_transform[1237x811-F] 7.2 ms 4.9 ms +46.87%
test_point_lut[1237x811-L] 4.7 ms 3.6 ms +31.88%
test_point_lut[1237x811-RGBA] 14.4 ms 11.8 ms +21.93%
test_point_transform[1237x811-RGBA] 14.7 ms 12.1 ms +21.36%
test_point_lut[1237x811-RGB] 12.7 ms 10.6 ms +19.14%
test_point_lut[1237x811-LA] 10.9 ms 9.5 ms +15.67%
test_point_transform[1237x811-LA] 11.2 ms 9.7 ms +15.16%

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 (1000b1b) with main (c8c74c8)

Footnotes

  1. 335 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.

hugovk commented Aug 9, 2026

Copy link
Copy Markdown
Member

Rebased following benchmark image update: #9831.

Comment thread src/libImaging/Point.c
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL