Skip to content

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

Merged
merged 7 commits into from
May 10, 2025

Conversation

Cwiiis
Copy link
Contributor

@Cwiiis Cwiiis commented Apr 25, 2025

Various optimisation work, mostly to enable work to be broken up into more manageable chunks and interrupted/cancelled more easily.

Chris Lord added 6 commits April 29, 2025 11:24
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
@Cwiiis Cwiiis force-pushed the private/cwiiis/more-scroll-optimsation branch from 2cdefa5 to 4792217 Compare April 29, 2025 14:04
@Cwiiis
Copy link
Contributor Author

Cwiiis commented Apr 29, 2025

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
@Cwiiis Cwiiis marked this pull request as ready for review April 30, 2025 09:44
@Cwiiis Cwiiis requested review from mmeeks and gokaysatir April 30, 2025 09:44
@Cwiiis
Copy link
Contributor Author

Cwiiis commented Apr 30, 2025

I think there's enough work here now that it's a good idea to get some/all of it merged.

@Cwiiis
Copy link
Contributor Author

Cwiiis commented Apr 30, 2025

And a quick note, this isn't intended for 25.04 :)

@mmeeks
Copy link
Contributor

mmeeks commented Apr 30, 2025

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.

Copy link
Contributor

@mmeeks mmeeks left a 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) {
Copy link
Contributor

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 =)

Copy link
Contributor

@mmeeks mmeeks left a 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.

@github-project-automation github-project-automation bot moved this from To Review to To Test in Collabora Online Apr 30, 2025
@mmeeks
Copy link
Contributor

mmeeks commented May 10, 2025

So - having explained the release schedule a bit better to Chris - lets get it in =)

@mmeeks mmeeks merged commit 4a6eb11 into master May 10, 2025
14 checks passed
@mmeeks mmeeks deleted the private/cwiiis/more-scroll-optimsation branch May 10, 2025 20:37
@github-project-automation github-project-automation bot moved this from To Test to Done in Collabora Online May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants