-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Improve EditorTable
performance
#27958
Conversation
osu.Game/Screens/Edit/EditorTable.cs
Outdated
@@ -30,6 +30,10 @@ public abstract partial class EditorTable : TableContainer | |||
|
|||
protected readonly FillFlowContainer<RowBackground> BackgroundFlow; | |||
|
|||
// We can avoid potentially thousands of objects being added to the input sub-tree since item selection is being handled by the BackgroundFlow | |||
// and no items in the underlying table are clickable. | |||
protected override bool ShouldBeConsideredForInput(Drawable child) => base.ShouldBeConsideredForInput(child) && child == BackgroundFlow; |
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.
minor nit:
protected override bool ShouldBeConsideredForInput(Drawable child) => base.ShouldBeConsideredForInput(child) && child == BackgroundFlow; | |
protected override bool ShouldBeConsideredForInput(Drawable child) => child == BackgroundFlow && base.ShouldBeConsideredForInput(child); |
That map is nowhere near as bad for me as your screenshots indicate. ~20ms -> ~8ms. It's a worthwhile improvement though I worry about the locality of these optimisations preventing similar issues from being tackled directly in o!f in the future. This is exactly the sort of situation which I'd expect I'm curious why your screenshots are showing 3000ms per frame? |
https://streamable.com/75hi6b |
It's one container per cell, right? And 95+% of those cells are off-screen. But more so than that
Are you using a 1000Hz poll rate mouse? I'm going to tentatively merge this, but be aware that this is one of the simplest cases I would hope o!f can easily optimise for. If not, it would affect things like comments container, beatmap listing overlay, markdown/wiki, etc. |
I'm not sure, but seems like it, because when window isn't focused and input thread is limited to 60fps - things are much better. |
The issue occurs while we are hovering the mouse over the table, generating input sub-tree with thousands of items that will be never used for input handling (with all the overhead that comes with it).
Map for testing: https://osu.ppy.sh/beatmapsets/1238185#mania/2574372