Speed up some conversions - #9807
Conversation
|
Rebased following benchmark image update: #9831. Edit: or not, due to conflict :) Merging |
Merging this PR will improve performance by 71.2%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_convert[1237x811-P-RGBA] |
9.9 ms | 4.9 ms | ×2 |
| ⚡ | test_convert[1237x811-P-RGB] |
9.3 ms | 5.1 ms | +81.24% |
| ⚡ | test_convert[1237x811-PA-RGB] |
10.7 ms | 6.5 ms | +64.05% |
| ⚡ | test_convert[1237x811-PA-RGBA] |
11.3 ms | 7.9 ms | +42.27% |
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-convert-x (b7e834c) with main (c8c74c8)
Footnotes
-
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. ↩
| "conversion from %.10s to %.10s not supported", | ||
| return (Imaging)PyErr_Format( | ||
| PyExc_ValueError, | ||
| "conversion from %s to %s not supported", |
There was a problem hiding this comment.
| "conversion from %s to %s not supported", | |
| "conversion from %.10s to %.10s not supported", |
This has the inadvertent change that was initially in #9863
There was a problem hiding this comment.
Could we get #9863 (double approved, CI green) merged so I can just rebase this on top of main?
There was a problem hiding this comment.
Just waiting to see if you had any thoughts on my final attempt to reformat the switch - akx#12
There was a problem hiding this comment.
@radarhere merged akx#10 instead, so waiting for the merge on #9863 to rebase this and get rid of this commit altogether here 👍
| "conversion from %.10s to %.10s not supported in convert_transparent", | ||
| return (Imaging)PyErr_Format( | ||
| PyExc_ValueError, | ||
| "conversion from %s to %s not supported in convert_transparent", |
There was a problem hiding this comment.
| "conversion from %s to %s not supported in convert_transparent", | |
| "conversion from %.10s to %.10s not supported in convert_transparent", |
Experiments to speed up the other conversions didn't really yield fruit.