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

Add pooling for mania barlines #24544

Merged
merged 2 commits into from
Aug 15, 2023
Merged

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Aug 15, 2023

At COE, it was brought up to me that this map wasn't loading: https://osu.ppy.sh/beatmapsets/501530#mania/1073952 Turns out that it is loading, just very slowly.

The primary reason is that it creates some 200k drawables, which this PR directly addresses. The implementation here is similar to the taiko one.

The second reason, which is not addressed in this PR, and likely doesn't need to be addressed, appears to be some inefficiency in HitObjectContainer resulting in what looks to be worst case sort complexity:

image

i.e. every object added to the HOC causes the HOC to immediately be re-sorted:

private void bindStartTime(DrawableHitObject hitObject)
{
var bindable = hitObject.StartTimeBindable.GetBoundCopy();
bindable.BindValueChanged(_ =>
{
if (LoadState >= LoadState.Ready)
SortInternal();
});
startTimeMap[hitObject] = bindable;
}

@peppy peppy merged commit 3526032 into ppy:master Aug 15, 2023
14 of 16 checks passed
@smoogipoo smoogipoo deleted the pool-mania-barlines branch September 11, 2023 02:29
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.

2 participants