Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid accessing WorkingBeatmap.Beatmap every update call #31775

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

peppy
Copy link
Member

@peppy peppy commented Feb 3, 2025

Notice in passing.

Comes with overheads that can be easily avoided. Left a note for a future (slightly more involved) optimisation.

Wouldn't have bothered with this because marginal-gains but it also makes the code/variables a bit easier to follow in the clock class.

JetBrains Rider-EAP 2025-02-03 at 07 35 31
JetBrains Rider-EAP 2025-02-03 at 07 36 52

Notice in passing.

Comes with overheads that can be easily avoided. Left a note for a
future (slightly more involved) optimisation.
Comment on lines 94 to 96
double firstHitObjectTime = working.Beatmap.HitObjects.First().StartTime;
if (working.Beatmap.AudioLeadIn > 0)
time = Math.Min(time, firstHitObjectTime - working.Beatmap.AudioLeadIn);
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are three accesses to WorkingBeatmap.Beatmap here - maybe just pass the IBeatmap here too? I guess this is initialisation code so the overhead isn't going to be comparably large here, but given we're fixing already...?

@bdach bdach merged commit 1793b8c into ppy:master Feb 3, 2025
10 checks passed
@peppy peppy deleted the avoid-beatmap-access-beat-sync-container branch February 4, 2025 04:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants