1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 02:17:46 +08:00
osu-lazer/osu.Game/Screens/Edit
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
..
Components Remove unused using 2024-04-24 01:00:03 -07:00
Compose Fix performance overhead from ternary state bindable callbacks when selection is changing 2024-06-04 10:32:12 +02:00
Design Enable nullability for design screen 2023-01-14 02:24:48 +03:00
GameplayTest Remove unused ruleset parameter when testing beatmap in editor 2024-03-01 20:28:52 +08:00
Setup Fix tests dying on a nullref 2024-05-24 11:25:29 +02:00
Timing Update focus specifications in line with framework changes 2024-05-22 21:32:49 +08:00
Verify Apply padding to GridContainers directly 2024-02-20 23:18:37 +03:00
BackgroundDimMenuItem.cs Use existing strings 2023-01-15 14:39:34 +03:00
BeatmapEditorChangeHandler.cs Change the way initial state saving works in EditorChangeHandler to be closer to first change 2023-02-07 16:22:51 +09:00
BindableBeatDivisor.cs Change name and description of force parameter in SetArbitraryDivisor 2024-01-25 05:12:54 -05:00
BottomBar.cs Apply padding to GridContainers directly 2024-02-20 23:18:37 +03:00
ClipboardContent.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
CreateNewDifficultyDialog.cs Localise create/save dialog 2023-01-15 01:50:47 +03:00
DeleteDifficultyConfirmationDialog.cs make ResetConfirmDialog properly utilise its parent's logic 2023-03-05 20:57:26 +01:00
Editor.cs Move workaround to subscreen 2024-05-24 10:35:33 +02:00
EditorBeatmap.cs Preserve storyboard events when saving a beatmap in the editor 2024-04-30 00:01:56 +08:00
EditorBeatmapSkin.cs Enable NRT in EditorBeatmapSkin 2024-02-23 14:52:44 +01:00
EditorChangeHandler.cs Change the way initial state saving works in EditorChangeHandler to be closer to first change 2023-02-07 16:22:51 +09:00
EditorClipboard.cs Automated pass 2023-06-24 01:00:03 +09:00
EditorClock.cs Fix incorrect test assumption in TestSceneEditorClock 2023-10-06 16:43:28 +09:00
EditorLoader.cs Move disables to loading screens for better coverage of edge cases 2023-07-30 13:45:42 +09:00
EditorRoundedScreenSettings.cs Automated pass 2023-06-24 01:00:03 +09:00
EditorRoundedScreenSettingsSection.cs Partial everything 2022-11-27 00:00:27 +09:00
EditorScreen.cs Move workaround to subscreen 2024-05-24 10:35:33 +02:00
EditorScreenMode.cs Localise part of editor 2023-01-15 01:50:47 +03:00
EditorScreenWithTimeline.cs Apply padding to GridContainers directly 2024-02-20 23:18:37 +03:00
EditorSkinProvidingContainer.cs Partial everything 2022-11-27 00:00:27 +09:00
EditorState.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
EditorTable.cs Adjust execution order 2024-04-22 07:02:49 +03:00
HitAnimationsMenuItem.cs Automated pass 2023-06-24 01:00:03 +09:00
IEditorChangeHandler.cs Add a basic change handler to the skin editor 2023-02-03 18:57:50 +09:00
LegacyEditorBeatmapPatcher.cs Fix slider velocity changes not being undone correctly 2023-10-30 10:59:02 +01:00
PromptForSaveDialog.cs Localise create/save dialog 2023-01-15 01:50:47 +03:00
SaveRequiredPopupDialog.cs Fix editor not prompting before saving beatmap for export 2023-10-25 14:39:46 +09:00
TransactionalCommitComponent.cs Change the way initial state saving works in EditorChangeHandler to be closer to first change 2023-02-07 16:22:51 +09:00
WaveformOpacityMenuItem.cs Automated pass 2023-06-24 01:00:03 +09:00