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

CommentSection layout is very expensive while scrolling #10747

Closed
Cwiiis opened this issue Dec 17, 2024 · 1 comment
Closed

CommentSection layout is very expensive while scrolling #10747

Cwiiis opened this issue Dec 17, 2024 · 1 comment
Labels
bug Something isn't working unconfirmed

Comments

@Cwiiis
Copy link
Contributor

Cwiiis commented Dec 17, 2024

Describe the Bug

If there are comment sections in a writer document (such as in the test document), layout of those sections shows up very high in the profile while scrolling. The comment sections only change their position while scrolling, so there's obviously a lot of expensive DOM queries going uncached here. Fixing this ought to markedly improve scrolling performance on documents with lots of comments.

Steps to Reproduce

  1. Open the test Writer document, start profiling and scroll up and down with the mouse wheel for a while.
  2. Observe that CommentSection.prototype.doLayout takes a significant portion of time

Drilling down into what's expensive, particularly getCommentHeight shows up taking almost half of the time (with most of that being getBoundingClientRect), and then what is presumably unnecessary class manipulation also shows up quite highly.

Expected Behavior

Given the comments are only changing position, I wouldn't expect any function within their class beyond setting their position to show up significantly in the profile.

@timur-g
Copy link
Contributor

timur-g commented Dec 25, 2024

Duplicate of #10748.

@timur-g timur-g closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
Archived in project
Development

No branches or pull requests

2 participants