-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Widget optimizations #4821
base: master
Are you sure you want to change the base?
Widget optimizations #4821
Conversation
72 -> 48 updates per letter typed in Textbox
48 -> 39 updates per letter typed in textbox with 100 options in Menu
Benchmark ResultsSHA: 25f463c2db9333628584bc94d00ddb9107ad3a16 Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
After some discussion with Simon we decided to skip the message counting tests for now. #4630 should make it possible to handle them more easily and across backends. So we'll defer them to there instead of wasting time here trying to figure out why these tests don't work here. |
Description
This pr is somewhat in response of #4074 but not solely focused on it. There are mainly two types of changes here:
First is removing
pick()
from all Blocks (except Axis3 center-on-click interactions). It requires data to be copied from the GPU to CPU which is very expensive compared to bounding box checks, which should be sufficient for blocks. I also added some debug tracking forpick()
calls and use those to test that blocks don't rely on themThe second type of changes is driven by message counts as reported by Bonito. Specifically, I ran code like this to check and compare message counts:
Commits with notes like
32 -> 4
refer to reductions in those message counts. Changes made in this context can have heavy overlap with or be made redundant by #4630. For example text input often creates a lot of redundant updates because most text things trigger an update of the glyph collection which then triggers an update of everything that depends on the glyph collection. #4630 is partially meant to deal with that, so there's little point in optimizing it here.Instead of that most of the message count reductions here are related to not doing unnecessary work.
With respect to #4074 mainly e7c5450 and 55cd8a7 are relevant. These commits remove updates of hidden menu items caused by layouting changes. Before there were 72 messages per letter typed and the total size scaled with the number of menu items. Now there are 39 (just Textbox triggers 30 per letter) and no scaling with the number of Menu items.
TODO:
add message count testsType of change
Checklist