1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 01:02:57 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/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
..
Blueprints Rename DEFAULT_HEIGHT to BASE_HEIGHT 2024-01-19 23:58:58 +03:00
Checks Refactor abstract check to reduce duplication 2024-03-26 11:13:03 +01:00
DrawableTaikoEditorRuleset.cs remove unnecessary ComputeTimeRange override 2024-02-23 14:22:56 +01:00
DrumRollCompositionTool.cs Automated pass 2023-06-24 01:00:03 +09:00
HitCompositionTool.cs Automated pass 2023-06-24 01:00:03 +09:00
SwellCompositionTool.cs Automated pass 2023-06-24 01:00:03 +09:00
TaikoBeatmapVerifier.cs Make check ruleset specific 2024-03-22 14:48:22 -03:00
TaikoBeatSnapGrid.cs Add beat snap grid to osu!taiko editor 2023-10-17 16:59:56 +09:00
TaikoBlueprintContainer.cs Automated pass 2023-06-24 01:00:03 +09:00
TaikoHitObjectComposer.cs Combine selection and input handling logic for beat snap grids across all rulesets 2023-10-17 17:09:42 +09:00
TaikoSelectionHandler.cs Fix performance overhead from ternary state bindable callbacks when selection is changing 2024-06-04 10:32:12 +02:00