-
Notifications
You must be signed in to change notification settings - Fork 813
Optimise scrolling to make scroll-handle scrolling feel better #11752
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
Conversation
Bounds creation shows up surprisingly high when scrolling due to its use in TileManager.updateTileDistance. Optimise the Bounds constructor to minimise the amount of unnecessary cloning. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: I5b43e49e565e38d07fa8640d649ee92142523f86
In the case that a keyframe or delta update doesn't result in a tile having an ImageData object, try to still maintain correct tile properties and maintain the empty tiles count. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: Ie940739030febdd1748f87e4dfad10aef4b57022
Handle Worker tile decompression 10ms at a time and allow messages to be processed between tile decompression. This should have no immediate effect, but lays the groundwork for transactions to be interrupted or cancelled. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: I91c04510411a3bb2124ccb08a923615cf7b99199
If a subsequent transaction makes a pending tile dehydration unnecessary, skip it to catch up more quickly. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: I3cd76e414536d2a762291ed857eee0dcdd3307ff
Instead of nesting pause/resume on tile dehydration, just pause once when we go to dehydrate a visible tile and resume when all tiles that don't require fetching have no pending updates. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: I9b3391556884a19678a3885f804577ed8ee8c88a
If we can't keep up with tile rehydration (which occurs commonly when dragging the scroll handle to cover a large distance quickly), don't expand the current area. This reduces the amount of dehydration work required and lets us push out more frames. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: I29c223985a63da815ff0a600694c8aaef7afca52
2cdefa5
to
4792217
Compare
This now feels a lot better, but a full, huge spreadsheet can still tax things, especially on 4k - multiple workers will help, but also perhaps just optimising the unrle code (though I expect gains there will be tough). Taking a look at both paths. We're not too far away from the native desktop performance here now, but I think we can be better (eventually). I don't like that turning off draw-pausing, though of course introduces a whole load of flicker, feels better in the worst-case scenario (fast scroll handle scrolling on a busy spreadsheet in high res + full-screen). I'd like to get to the point where we can keep a coherent render without sacrificing the refresh rate too significantly. |
Using a Map enables more efficient iteration/storage and gives us more type-checking. Signed-off-by: Chris Lord <chris.lord@collabora.com> Change-Id: Ib2ad73f9a2306c1864bb3a361f4089dfbc602512
I think there's enough work here now that it's a good idea to get some/all of it merged. |
And a quick note, this isn't intended for 25.04 :) |
If it's not in 25.04 we delay a year; we have a release today - we'll have another red release in a week or two - if it improves things we should get it in. |
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.
Hmm - does this work - how about fast typing on a screen rather than scrolling. Hitting '.' with a quick typematic rate, holding down 'enter' in writer or somesuch? Can get it in but - surely this could defer for ever if we have new tiles being slurped and then queued for dehydration that are visible (?)
@@ -475,6 +476,26 @@ class TileManager { | |||
} | |||
} | |||
|
|||
if (this.pausedForDehydration) { |
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.
I guess my previous comment was intended for this =)
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.
Generally it'd be good to get in I guess - but let be testing quick typing back to back on the same page of several users (there is an auto-typer in Ctrl-Alt-Shift-D) to check we're not regressing.
So - having explained the release schedule a bit better to Chris - lets get it in =) |
Various optimisation work, mostly to enable work to be broken up into more manageable chunks and interrupted/cancelled more easily.