Skip to content

Correct id-based keying of scatter plot pixmap cache#1564

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
lidstrom83:scatterplot
Feb 9, 2021
Merged

Correct id-based keying of scatter plot pixmap cache#1564
j9ac9k merged 3 commits intopyqtgraph:masterfrom
lidstrom83:scatterplot

Conversation

@lidstrom83
Copy link
Copy Markdown
Contributor

Note: naively using the id function results in non-unique keys.

Alternatively, we could serialize the Qt objects and use these in the key. This would provide protection from the user mutating these later, but at a cost to performance.

Note: naively using the id function results in non-unique keys.

Alternatively, we could serialize the Qt objects and use these in the key. This would provide protection from the user mutating these later, but at a cost to performance.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 9, 2021

hey @lidstrom83 good to see you back here. Thanks for this update. @danielhrisca would you mind benchmarking this branch in your tool? I'd like to see how it compares.

@lidstrom83
Copy link
Copy Markdown
Contributor Author

Hey @j9ac9k, do you have any preference for the performance vs. safety trade-off between the id vs. serialization cache key approaches?

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 9, 2021

Hey @j9ac9k, do you have any preference for the performance vs. safety trade-off between the id vs. serialization cache key approaches?

I do not, primarily because I don't have a good way to profile so it's hard to evaluate and make a fair comparison.

In terms of specific to this PR, my standard is simple, does it improve on the current implementation? yes (and it works); then merge. I don't want to hold up changes on ScatterPlotItem based on what the ideal implementation would be.

@danielhrisca
Copy link
Copy Markdown
Contributor

pyqt fps bench asammdf plot asammdf plot 5x zoom in
master 195 fps 16.2s 37.34s
lindstrom83:scatterplot 250 fps 8.8s 19.06s

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 9, 2021

That's absolutely great!

EDIT just to verify, this is an improvement over 0.11.0 as well?

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 9, 2021

@lidstrom83 you planning any other changes on this PR or is this guy ready to merge?

@danielhrisca
Copy link
Copy Markdown
Contributor

danielhrisca commented Feb 9, 2021

That's absolutely great!

EDIT just to verify, this is an improvement over 0.11.0 as well?

pyqtgraph fps bench asammdf plot asammdf plot 5x zoom in
master 195 fps 16.2s 37.34s
lindstrom83:scatterplot 250 fps 8.8s 19.06s
0.11.0 235 fps 5.11s 13.7s

@danielhrisca
Copy link
Copy Markdown
Contributor

master and this PR were only tested with _USE_QRECT=False

@lidstrom83
Copy link
Copy Markdown
Contributor Author

@lidstrom83 you planning any other changes on this PR or is this guy ready to merge?

No, this PR is done now. I'll dig further to get to the bottom of the rest of @danielhrisca's slowdown.

@j9ac9k j9ac9k merged commit aed2382 into pyqtgraph:master Feb 9, 2021
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 9, 2021

Sounds good, Merging. Thanks @lidstrom83 @danielhrisca thanks for the benchmark info too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants