1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 08:37:24 +08:00
osu-lazer/osu.Game/Screens/Edit/Compose/Components
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
..
Timeline Update focus specifications in line with framework changes 2024-05-22 21:32:49 +08:00
BeatDivisorControl.cs Update focus specifications in line with framework changes 2024-05-22 21:32:49 +08:00
BeatDivisorPresetCollection.cs Use new LINQ Order() instead of OrderBy() when possible 2024-02-08 18:01:00 +01:00
BeatDivisorType.cs Remove redundant nullable suppression directives 2023-06-07 08:20:41 +03:00
BeatSnapGrid.cs Add beat snap grid to osu!taiko editor 2023-10-17 16:59:56 +09:00
BlueprintContainer.cs Check if blueprint is in SelectionBlueprints before changing its depth 2024-04-02 07:45:27 -03:00
CircularDistanceSnapGrid.cs Update usage of CircularProgress.Current 2024-03-06 12:13:10 +08:00
ComposeBlueprintContainer.cs Use new icons in editor 2023-12-27 17:42:18 +01:00
DistanceSnapGrid.cs Privatise setter 2023-06-16 16:24:07 +02:00
DragBox.cs Update R# + fix inspections 2024-02-02 21:00:28 +09:00
EditorBlueprintContainer.cs Rectify selection keep-alive logic 2023-11-20 21:57:14 +09:00
EditorInspector.cs Move editor inspector classes out of ruleset namespace 2023-05-05 15:57:38 +09:00
EditorSelectionHandler.cs Fix performance overhead from ternary state bindable callbacks when selection is changing 2024-06-04 10:32:12 +02:00
HitObjectInspector.cs Rename SliderVelocity to SliderVelocityMultiplier to distinguish from Velocity 2023-09-06 19:01:08 +09:00
HitObjectOrderedSelectionContainer.cs Manual fixes to reduce warnings to zero 2023-06-24 01:52:53 +09:00
MoveSelectionEvent.cs Automated pass 2023-06-24 01:00:03 +09:00
RectangularPositionSnapGrid.cs Use better safety in rectangular grid 2023-07-28 22:57:02 +02:00
ScrollingDragBox.cs Partial everything 2022-11-27 00:00:27 +09:00
SelectionBox.cs Use better name if we're renaming 2024-05-29 09:40:29 +02:00
SelectionBoxButton.cs Add a visual effect when keyboard shortcuts are used to trigger selection box buttons 2023-06-27 17:01:13 +09:00
SelectionBoxControl.cs Add a visual effect when keyboard shortcuts are used to trigger selection box buttons 2023-06-27 17:01:13 +09:00
SelectionBoxDragHandle.cs Partial everything 2022-11-27 00:00:27 +09:00
SelectionBoxDragHandleContainer.cs change names 2023-08-29 17:25:52 +02:00
SelectionBoxRotationHandle.cs Fix crash when dragging rotation control in editor with both mouse buttons 2024-01-03 13:34:50 +09:00
SelectionBoxScaleHandle.cs Fix aspect ratio lock applying when shift pressed on a non-corner anchor 2024-05-23 15:08:43 +02:00
SelectionHandler.cs Refactor scale handling in editor to facilitate reuse 2024-01-20 00:22:53 +01:00
SelectionRotationHandler.cs Use better name if we're renaming 2024-05-29 09:40:29 +02:00
SelectionScaleHandler.cs refactor CanScaleFromPlayfieldOrigin and GetClampedScale to derived class 2024-05-28 17:12:16 +02:00