-
Notifications
You must be signed in to change notification settings - Fork 3.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
Improve performance of inserting blocks into stacks. #6130
Comments
So after some work on this, imo removing the extra render calls needs to be more of a project (with an actual design doc and whatnot). Currently our only way to delay/remove some of these render calls is to set Also going to link this to #5375 as refactoring insertion markers will have to take into account when we trigger renders. |
So I dug into eliminating the duplicate renders, and it's a bit buggy, but I got some really promising efficiency improvements! ~5x faster for dragging JS spaghetti blocks. What I'm doing is creating a tree of blocks that need to be rerendered (so for each leaf block that needs to be rerendered, it also adds all of that leaf's parents). Then inside a Additionally, I added a delay to the Changes are on https://github.com/BeksOmega/blockly/tree/exp/render-queue |
Describe the bug
Current performance on 7eebd78:
![Screenshot 2022-04-29 9 27 37 AM](https://user-images.githubusercontent.com/25440652/165985923-82f084b3-3ec7-42d9-a2f4-2771e582b829.png)
Time to execute endDrag = ~52 ms averaged over 5 trials.
Convert the following txt file to a json file and then load it into your Chrome Dev Tools to view the results:
inserting-1.txt
To Reproduce
Steps to reproduce the behavior:
Go to the performance tab of the chrome devtools.
Enable recording screenshots.
Set CPU Throttling to 6x.
Start a recording.
Insert the single block into the stack of two blocks so that it looks like this:
![image](https://user-images.githubusercontent.com/25440652/165986799-a2eb876c-09ad-45be-8c19-f8447e3e63b0.png)
Stop the recording.
Expected behavior
Ideally, we wouldn't drop frames when inserting blocks. For this to be achieved, inserting needs to complete within 10ms.
Additional context
It looks like
hidePreview_
is doing a lot of work (~22ms), and triggering a lot of re-renders I'm hoping that can be cleaned up.Similarly with
connect
(~16ms).This one is going to take some more digging though.
The text was updated successfully, but these errors were encountered: