Repository navigation
Conversation
Merging this PR will improve performance by 35.23%3 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
|
Seems to do the trick as expected 😄 |
|
My comment on that PR was
So it's not clear what you were expecting by re-opening this. We can leave it for someone else to review if you want. |
To restore line drawing performance to what it was in Pillow 13.0.0, before #9982 was merged. I don't think you meant to regress drawing performance with 30657fb, or if you did, I'd like to know why. To be clear, you suggested that commit via akx#37 but CodSpeed didn't run there, and I couldn't tell by reading that it'd regress performance. Before CodSpeed could run and reveal that that commit regressed performance, it had been merged. |
|
I didn't realise that akx#37 would affect performance, I merely thought that it would simplify the code. I think performance is balanced against functionality and simplicity, and if closing this PR means that Pillow draws lines slightly slower than Pillow 13.0.0, then ok. |
|
I understand you didn't realise it, I didn't realise it either before the Codspeed numbers came in, and I've been trying to fix this ever since. This ended up being more elegant than the Looking at that CodSpeed report, I don't think those are "slightly slower" numbers for the common modes (RGB, RGBA), especially since the fix is pretty simple (and only has that many "pesky backslashes" because clang-format rules force wrapping the block like that). Anyway, I'm happy to hear what other reviewers think, because a net +18 lines to be 40% more efficient when drawing lines does not sound like a bad tradeoff. |
|
... And as noted above, this would apparently require another reviewer to look at it. @aclark4life, maybe, please? |
This is a rebase of 24e3fed from #9772 following the merge of the dashed-drawing PR #9490.
This should walk back the inadvertent performance regression from 30657fb.
A subsequent PR, when I have the PR-opening quota for it, will take a look at the other issues with the dash PR (such as, as I suggested in its comments, precomputing the dashing into a C-side struct to avoid repeated conversion).