1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00
osu-lazer/osu.Game/Screens
Bartłomiej Dach f13ca28d5e
Fix performance overhead from ternary state bindable callbacks when selection is changing
Closes https://github.com/ppy/osu/issues/28369.

The reporter of the issue was incorrect; it's not the beat snap grid
that is causing the problem, it's something far stupider than that.

When the current selection changes,
`EditorSelectionHandler.UpdateTernaryStates()` is supposed to update the
state of ternary bindables to reflect the reality of the current
selection. This in turn will fire bindable change callbacks for said
ternary toggles, which heavily use `EditorBeatmap.PerformOnSelection()`.

The thing about that method is that it will attempt to check whether any
changes were actually made to avoid producing empty undo states, *but*
to do this, it must *serialise out the entire beatmap to a stream* and
then *binary equality check that* to determine whether any changes were
actually made:

	7b14c77e43/osu.Game/Screens/Edit/EditorChangeHandler.cs (L65-L69)

As goes without saying, this is very expensive and unnecessary, which
leads to stuff like keeping a selection box active while a taiko beatmap
is playing under it dog slow. So to attempt to mitigate that, add
precondition checks to every single ternary callback of this sort to
avoid this serialisation overhead.

And yes, those precondition checks use linq, and that is *still* faster
than not having them.
2024-06-04 10:32:12 +02:00
..
Backgrounds Fix incorrect background being loaded due to async race 2024-05-01 00:05:14 +08:00
Edit Fix performance overhead from ternary state bindable callbacks when selection is changing 2024-06-04 10:32:12 +02:00
Footer Remove unused using directives 2024-05-16 07:47:57 +03:00
Import Merge branch 'master' into update-framework 2022-11-26 16:19:36 +01:00
Menu Fix occasional test failures on new menu content tests 2024-06-03 12:24:56 +09:00
OnlinePlay Fix mod display not being aligned with mapper text 2024-05-27 13:36:44 +02:00
Play Fix xmldoc reference 2024-05-27 08:26:00 +02:00
Ranking Apply NRT to results statistics displays 2024-05-14 15:21:12 +02:00
Select Merge branch 'master' into lazer-speedkeys 2024-05-24 13:19:26 +02:00
SelectV2/Footer Merge branch 'master' into footer-v2-back-button 2024-05-28 15:50:34 +09:00
Spectate Remove managed clocks from SpectatorSyncManager on gameplay completion / abort 2024-04-26 15:29:59 +08:00
Utility Calculate unstable rate using rate-adjusted offsets 2023-11-10 19:57:44 -08:00
BackgroundScreen.cs Unload beatmap storyboard background when no longer present 2023-11-09 17:20:11 +03:00
BackgroundScreenStack.cs Use alternative method of scheduling storyboard unload 2023-11-16 15:37:53 +09:00
IHandlePresentBeatmap.cs Automated pass 2023-06-24 01:00:03 +09:00
IHasSubScreenStack.cs Automated pass 2023-06-24 01:00:03 +09:00
IOsuScreen.cs Allow screens to change the ability to interact with the global track 2023-07-25 20:20:53 +09:00
IPerformFromScreenRunner.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
Loader.cs Remove disclaimer screen completely 2023-12-28 17:21:29 +09:00
OsuScreen.cs Apply alternative solution 2024-01-29 20:07:27 +01:00
OsuScreenDependencies.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
OsuScreenStack.cs Manual fixes to reduce warnings to zero 2023-06-24 01:52:53 +09:00
ScorePresentType.cs Remove redundant nullable suppression directives 2023-06-07 08:20:41 +03:00
ScreenWhiteBox.cs Partial everything 2022-11-27 00:00:27 +09:00
StartupScreen.cs Automated pass 2023-06-24 01:00:03 +09:00