-
Notifications
You must be signed in to change notification settings - Fork 399
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
Add virtualised list container #6312
Conversation
|
||
for (int i = 0; i < e.NewItems!.Count; ++i) | ||
{ | ||
Items.Insert(Math.Max(e.NewStartingIndex, 0) + i, new ItemRow((TData)e.NewItems![i]!, pool) |
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 this is the best we can do without a lot more work (potentially avoiding using a FillFlowContainer
altogether?), but we're still living with one (very lightweight) drawable per row here. Based on your profiling results it seems like this is still going to be enough to help for the cases we're looking at fixing, but something worth noting.
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.
Yes, I was aware that there was room for improvement still technically if we wanted to, but decided in the end that the tradeoff in implementation complexity did not seem worth it at this time.
RFC.
Game-side, we have a few lists/tables which perform dreadfully when stressed by a large number of rows/columns. Two of them reside in the editor, namely: the timing table and the verify issue list table.
The primary overheads in both are:
TableContainer
#6282.) Mitigation of this has been applied viadumbhacks like having the background of the table be a separate drawable under it and have it handle input. I was sorta hopingShouldBeConsideredForInput
could maybe fix this but it regretfully does not (it reduces some overhead but not enough to be acceptable yet).What this pull is intended to introduce is a sort of
UITableView
but for osu!framework usage out-of-the-box.VirtualisedListContainer
, and give a model and a drawable for it via the generic specs.ModelBackedDrawable
because I can't inherit from bothPoolableDrawable
and that, soIHasCurrentValue
it is)For testing there is the test scene added here, but there's also this branch (needs to be cleaned up yet, very PoC). In my vague "performance testing" (read: looking at frame graph times), on a stress test like https://osu.ppy.sh/beatmapsets/1238185#mania/2574372 this can improve FPS by factors of 5 to even an order of magnitude:
(both tested on release configuration, with static mouse).
The pooling takes care of the drawable construction overheads, and the lifetime games this container plays help with input handling (if a child isn't alive, it doesn't get looked at with respect to input at all). Collection changes are handled somewhat efficiently (better than reconstructing everything from scratch, at least).
The one case that is still not as fast as I perhaps would have hoped for is active scrolling, but it's still better than it was.