Skip to content
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

feat(DummyInputs): Optimizing the dummy transform offsets to reduce the reflows. #264

Merged
merged 6 commits into from
Apr 6, 2023

Conversation

mshoho
Copy link
Member

@mshoho mshoho commented Apr 4, 2023

getComputedStyle() causes reflow, accessing element.scrollTop and element.scrollLeft causes reflow. Setting element.style.top and element.style.left in between the above makes it all even worse.

This PR:

  1. Caches the result of the things that cause reflow for the bulk during the update.
  2. Splits computing the dummy input position and setting it into two phases to do the bulk computation first and the bulk position update next.
  3. Improves the data structures usage in the computation.

@ling1726
Copy link
Member

ling1726 commented Apr 5, 2023

How do you know these changes improve perf? have you taken any profiles or before vs after?

@mshoho
Copy link
Member Author

mshoho commented Apr 5, 2023

How do you know these changes improve perf? have you taken any profiles or before vs after?

We are looking at the snapshots with the perf team. This one is definitely improving it and I've just pushed another update to improve the timers (after testing the previous change with the perf folks). Releasing next canary right now and once I have the confirmation it's making things even better, it should be ready to be merged.

Tabster Build and others added 2 commits April 5, 2023 16:36
@mshoho mshoho merged commit b3f5575 into master Apr 6, 2023
2 checks passed
@mshoho mshoho deleted the dummy-inputs-further-optimization branch April 6, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants