access QPainterPathPrivate for faster arrayToQPath#2324
access QPainterPathPrivate for faster arrayToQPath#2324j9ac9k merged 3 commits intopyqtgraph:masterfrom
Conversation
Results of running |
|
Hi @pijyoi on my 2019 Macbook Pro I recorded a change of performance of 330 fps -> 345 fps with this change. This is substantial enough that it is worth adopting IMO. As with the risk of Qt changing its internals, we should likely add tests to ensure that the paths generated like you propose here are equivalent to paths generated via the "slow" methods so that if things do change, our test suite catches it. |
On my Windows laptop, I got a rather more substantial increase of 360 --> 450. |
|
I have a native windows platform and a much older macOS system to test on
as well, will report results there. I don’t have ARM or 32bit systems to
test on tho.
…On Sun, Jun 5, 2022 at 10:09 pijyoi ***@***.***> wrote:
on my 2019 Macbook Pro I recorded a change of performance of 330 fps ->
345 fps with this change.
On my Windows laptop, I got a rather more substantial increase of 360 -->
450.
On the same laptop with Linux running on WSLg, I got 265 --> 310.
—
Reply to this email directly, view it on GitHub
<#2324 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE5Z7WN26EBQP4RZTUTOR3VNTNLVANCNFSM5X4KGDQQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
This LGTM thanks for the PR and thanks for testing! |
|
Results from a quick test of |
Woah that pairs speed! That's for testing and sharing your results |
This PR allows populating
QPainterPathwithout having to go through the serialization / deserialization steps.Where the serialization / deserialization could still be considered a public API (although the binary serialized format is not publicly documented), this method clearly strays into the Qt private internals.
To see this in action, run
PlotSpeedTest.pyand switch to 'array' (or 'pairs') mode. Then toggle theenableExperimentalcheckbox to activate this new method.On my system, this brings
array's performance on par withall's performance. (This raises the possibility of making allconnectkinds be implemented simply in terms ofarray)Obviously, the Qt library is free to change its internal private implementation at any time, which would break this method.
Not tested on 32-bit systems. The ctypes used should be correct on both 32-bit / 64-bit though.