Skip to content

Speed up Image.filter()#9736

Open
akx wants to merge 4 commits into
python-pillow:mainfrom
akx:filter-loops
Open

Speed up Image.filter()#9736
akx wants to merge 4 commits into
python-pillow:mainfrom
akx:filter-loops

Conversation

@akx

@akx akx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Refs #9649, #9675 (same series, same techniques).

@codspeed-hq

codspeed-hq Bot commented Jun 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 331 untouched benchmarks


Comparing akx:filter-loops (7c81174) with main (6590b1b)

Open in CodSpeed

@akx

akx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@codspeed-hq Silly! 😄 It does improve performance, but only about 2% to 10% so it's under your improvement threshold...

@akx akx marked this pull request as ready for review June 30, 2026 08:28
Comment thread src/libImaging/Filter.c
akx added 4 commits June 30, 2026 15:00
_i2f is a compatibility shim for `(float)` for pre-2015 versions of GCC
(added in 2017 in ef1df61).

Compilers can presumably optimize `(float)` better than an inline function call.

The helper is then unused and removed.
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