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

Invalidate GridContainer only on DrawSize change #6180

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

EVAST9919
Copy link
Contributor

Recomputing GridContainer's layout is pretty allocation-heavy, which is happening during DrawInfo invalidation (common case - position change such as scrolling through overlays, comments, etc.).

Changing invalidation from DrawSize to Invalidation.DrawInfo | Invalidation.RequiredParentSizeToFit was a deliberate choice in b0f4473 since looks like at the time of it's implementation nested grids weren't working properly.
Снимок экрана 2024-02-16 235845
However currently it seems like everything works fine somehow: tests are passing and as far as I can tell everything is good osu-side.
Also FlowContainer has similar logic and it relies only on DrawSize invalidations which has been more than enough for years.
So I dunno. More eyes can find any problems if there are any, so I figured it's better to open a pr than just sitting on it guessing.

Example of scrolling in beatmap listing:

master pr
master pr

Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see any regressions from this.

@peppy peppy self-requested a review February 17, 2024 01:49
@peppy peppy requested a review from smoogipoo February 17, 2024 06:36
@smoogipoo
Copy link
Contributor

Yeah. It's weird, but I also can't notice any regressions.

Either we're going to relearn that cache invalidation is one of the hardest problems, or everything will work out fine. Let's see how it goes :)

@smoogipoo smoogipoo merged commit b89c970 into ppy:master Feb 17, 2024
21 checks passed
@EVAST9919 EVAST9919 deleted the grid-alloc branch February 17, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants