Skip to content

Speed up ImageChops operations - #9738

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
akx:faster-chops
Jul 1, 2026
Merged

Speed up ImageChops operations#9738
hugovk merged 1 commit into
python-pillow:mainfrom
akx:faster-chops

Chops: hoist size vars and add restrict in CHOP/CHOP2 macros

29314c7
Select commit
Loading
Failed to load commit list.
CodSpeed HQ / CodSpeed Performance Analysis succeeded Jun 30, 2026 in 0s

Performance Gate Passed

⚠️ 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

⚡ 36 improved benchmarks
✅ 295 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_chops[1024x1024-RGBA-add_modulo] 18.6 ms 6.5 ms ×2.8
test_chops[1024x1024-LA-add_modulo] 18.6 ms 6.5 ms ×2.8
test_chops[1024x1024-RGB-add_modulo] 18.6 ms 6.5 ms ×2.8
test_chops[1024x1024-L-add_modulo] 4.7 ms 1.7 ms ×2.8
test_chops[1024x1024-LA-darker] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-LA-lighter] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-RGBA-lighter] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-RGBA-darker] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-RGB-darker] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-RGB-lighter] 26.8 ms 11 ms ×2.4
test_chops[1024x1024-L-lighter] 6.7 ms 2.8 ms ×2.4
test_chops[1024x1024-L-darker] 6.7 ms 2.8 ms ×2.4
test_chops[1024x1024-LA-add] 32.6 ms 14.1 ms ×2.3
test_chops[1024x1024-RGBA-add] 32.6 ms 14.1 ms ×2.3
test_chops[1024x1024-RGB-add] 32.6 ms 14.1 ms ×2.3
test_chops[1024x1024-L-add] 8.2 ms 3.6 ms ×2.3
test_chops[1024x1024-RGBA-subtract] 29.1 ms 14.4 ms ×2
test_chops[1024x1024-LA-subtract] 29.1 ms 14.4 ms ×2
test_chops[1024x1024-RGB-subtract] 29.1 ms 14.4 ms ×2
test_chops[1024x1024-L-subtract] 7.3 ms 3.7 ms ×2
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

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-chops (29314c7) with main (e234120)

Open in CodSpeed