-
Notifications
You must be signed in to change notification settings - Fork 0
perf: second-pass hot-path audit — MathF, DimmablePieces cache, Taiko loop #308
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
Changes from 13 commits
3f5c113
7f385c7
1818c1b
066ad47
80d7543
6585152
4a57187
32c6732
7940a25
4d7aa83
a6e65e8
7bddedd
da43f16
17febd8
3cd3d90
31a95b0
aa829ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
| // See the LICENCE file in the repository root for full licence text. | ||
|
|
||
| using osu.Game.Database; | ||
|
|
||
| namespace osu.Android | ||
| { | ||
| /// <summary> | ||
| /// Android-specific <see cref="BackgroundDataStoreProcessor"/> that extends the sleep | ||
| /// interval during active gameplay from the default 30 s to 2 minutes. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// On Android the high-performance session (<see cref="Performance.AndroidHighPerformanceSessionManager"/>) | ||
| /// flips <c>GCSettings.LatencyMode</c> to <c>SustainedLowLatency</c> for the entire gameplay window, | ||
| /// which suppresses Gen-2 (major) GC collections. The background processor's sleep loop also | ||
| /// suspends during gameplay, but wakes every <see cref="BackgroundDataStoreProcessor.TimeToSleepDuringGameplay"/> | ||
| /// ms to re-check the condition. Each wake-up incurs a managed thread resume + lock acquisition, | ||
| /// generating a small burst of GC-visible allocations. At 30 s those spurious wakes happen ~10× | ||
| /// per typical 5-minute play session; at 120 s they drop to ~2×, cutting the associated | ||
| /// allocation pressure and the risk of a GC stall at the worst possible moment. | ||
| /// </remarks> | ||
| public class AndroidBackgroundDataStoreProcessor : BackgroundDataStoreProcessor | ||
|
Check warning on line 22 in osu.Android/AndroidBackgroundDataStoreProcessor.cs
|
||
| { | ||
| // 2-minute polling interval while gameplay is active (vs. the default 30 s). | ||
| protected override int TimeToSleepDuringGameplay => 120_000; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.