-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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
fix(performance): optimize progressive rendering performance #15870
Conversation
Also for series with trail effect
Thanks for your contribution! The pull request is marked to be |
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.
LGTM
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
Before this change for each frame during progressive rendering, we will traverse all elements in the storage to update z, blend, states, etc. Which brings lots of unnecessary extra cost because we only have to update the new rendered elements.
So this PR we add
eachRendered
method to traverse the new rendered elements inview/Chart.ts
. And for the series that support progressive rendering will be responsible to manage which elements are rendered in this frame. When updating z, blend, states, we can simply useeachRendered
instead of previouslyview.group.traverse
.Besides this major change. We also drop the use of
IncrementalDisplayable
. It seems to be an overdesign. We only use it inLargeSymbolDraw
andLargeLineDraw
. For these two cases, we can merge the points to reduce the number of elements. The code is simpler, and we can have tooltip and event on the large mode with progressive rendering now:)Also we brings a new strategy to support special series being separated in an individual
zlevel
automatically. For example, progressively rendered scatter and lines series will be used so that they won't be affected when doing progressive rendering. And for a long time developers need to configure zlevel manually for lines with trail effect, now it can be done automatically.