Speed up connect='all' in the presence of non-finite#2036
Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom Oct 22, 2021
Merged
Speed up connect='all' in the presence of non-finite#2036j9ac9k merged 1 commit intopyqtgraph:masterfrom
j9ac9k merged 1 commit intopyqtgraph:masterfrom
Conversation
Member
|
Nice find @pijyoi this LGTM. It's interesting the performance improvement, while improving with the size of the array, doesn't seem to improve at the same rate as the size of the array. Guess that's just a testament to how efficient you made Always great to have a performance boost for our most common use-case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While developing #2011 and #2032, which use alternative techniques for creating the plotting path, it was realized that
connect='all'does not require the use offunctions._compute_backfill_indices. One could simply filter away the non-finite data.The functionality of
functions._compute_backfill_indicescame from #1287. However that was for when all path creation went through the>>operator technique, which would reject the entire path in the presence of any non-finite data (since Qt 5.12.3 according to #1287.)With the implementation of #1796,
connect='all'path creation no longer goes through the>>operator technique. Thus the reason for running the data throughfunctions._compute_backfill_indiceswas no longer valid. And hence this PR.Thanks to the non-copy technique used in #1965, removing the non-finite data does not involve an extra copy.
asv execution: only relevant column is "all"
For the 10000 element rows, timing of
WithNonFinitedropped from 203us (master) to 125us (this PR), making it competitive with theAllFinitetiming of 101us.