-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of Wrapper components (Chart, Group, Stack) #1494
Merged
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6d81165
wip
dmmulroy 36638d1
Remove debugger, unused test demo, rename files
dmmulroy f789537
rename demo name
dmmulroy a49f3b6
fix bar tests + demo
dmmulroy 8ecaecd
uncomment demo code
dmmulroy ec88e5c
swap nestedChildren impl
dmmulroy 8ca2806
fix comment and remove test demo
dmmulroy 566f57f
typo
dmmulroy f4e0933
wip
dmmulroy 345fb66
wip
dmmulroy 782d081
clean up wip
dmmulroy e7911e9
bail out on calls to getChildren if its not a stacked component
dmmulroy fbca897
remove testing demo
dmmulroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the issue for stacking. The domain won't be correctly calculated if
VictoryStack
getChildren
isn't called when calculating the domain, because the y0 / y1 values wont be set on the children. I'm guessing removing this is also where we're getting most of our perf improvements, though. It's probably worth writing a specialized method for calculating a domain for VictoryStack.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this! I'll start poking around to see what I can figure out 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... we also have to make sure that
VictoryChart
andVictoryGroup
actually useVictoryStack
'sgetDomain
method. Maybe it should be a static on that class the same way it is on components likeVictoryBar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually looking into potentially having
VictoryChart
andVictoryGroup
properly calculatey0
andy1
in theirgetCalculatedProps
so we can bank on the those values being available/memoized on subsequent/childgetCalculateProps
calls.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm using the wrong terms... I mean
_y0
and_y1
. Values that get added to each data point when we stack valuesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had a ton of time to spend on this since last week, but I did figure out a small win to fix the regression (I think, still need to check chromatic). It does decrease performance, from 690 milliseconds to about 1.07 seconds, and also increased the number of
reduceChildren
from 21 to 771, but that is significantly better than the original 7234 calls.