perf: framework 2026.519.1 bump + deep System.Numerics hot-path optimization pass - #342
Merged
winnerspiros merged 4 commits intoMay 19, 2026
Conversation
… optimizations Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/c0af79df-8006-4631-912e-eef9cc6d726b Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/f74b2f21-6bd8-45e8-b698-3737ddf65ed7 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
winnerspiros
May 19, 2026 18:25
View session
…method) Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/850e952a-f9d0-41e8-8029-923e55c58bcf Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
winnerspiros
approved these changes
May 19, 2026
… in OsuModTargetPractice Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/ce8f0232-7f26-43f2-bd5a-69bdb0e1b292 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
winnerspiros
approved these changes
May 19, 2026
There was a problem hiding this comment.
Pull request overview
Bumps the winnerspiros osu-framework fork from 2026.517.1 → 2026.519.1 and applies a broad pass of hot-path micro-optimizations across osu.Game and the rulesets: replaces Math.* with MathF.* (avoiding double-precision intermediates), swaps Vector2.Distance for Vector2.DistanceSquared where the result is only compared, hoists invariant trig/exp computations out of loops, and rewrites pow(x,a)/x as pow(x,a-1).
Changes:
- Framework package bumps to 2026.519.1 in
osu.Game.csproj,osu.Android.props,osu.iOS.props(and updated comment). Math.*→MathF.*/float.*(Clamp, Lerp, Sin, Cos, Sqrt, Abs, etc.) across many files to cut double↔float casts; hoisted invariants inBezierConverter,StarRatingSequence,AccuracyHeatmap.- Distance comparisons changed to
DistanceSquared/LengthSquared(avoiding sqrt) in osu/catch editor blueprints, slider ball, autogenerator, difficulty preprocessing, etc.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| osu.Game/osu.Game.csproj, osu.Android.props, osu.iOS.props | Framework package bump to 2026.519.1 |
| osu.Game/Seasonal/IntroChristmas.cs | Replace Math.* with MathF.* in particle math |
| osu.Game/Screens/Play/HUD/ArgonSongProgressBar.cs | MathF.Abs over Math.Abs |
| osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Intro/StarRatingSequence.cs | Hoist Math.Exp call outside the per-bar/per-child loops |
| osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/SongPreviewParticleContainer.cs | MathF.Cos instead of double Math.Cos |
| osu.Game/Screens/OnlinePlay/Matchmaking/Queue/CloudVisualisation.cs | MathF.Min over Math.Min |
| osu.Game/Screens/Menu/OsuLogo.cs | Cache length and use MathF.Pow with negated exponent |
| osu.Game/Rulesets/Objects/BezierConverter.cs | Hoist cos/sin of ThetaStart outside loop |
| osu.Game/Overlays/NowPlayingOverlay.cs, Notifications/Notification.cs | Cache length, pow with negated exponent |
| osu.Game/Overlays/MedalAnimation.cs | MathF for offset trig |
| osu.Game/Graphics/ParticleSpewer.cs | float.Lerp/float.Clamp; remove Utils import |
| osu.Game/Graphics/Cursor/MenuCursorContainer.cs | DistanceSquared comparison |
| osu.Game/Graphics/Backgrounds/Triangles.cs, TrianglesV2.cs | MathF Box–Muller transform |
| osu.Game.Rulesets.Taiko/Skinning/Legacy/* | MathF.Min/Max/Abs for kiai alpha |
| osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs | Precompute innerRadius² and compare DistanceSquared |
| osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs | Math.Clamp → float.Clamp |
| osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs | MathF.Max for interval multiplier |
| osu.Game.Rulesets.Osu/Skinning/Default/SpinnerCentreLayer.cs, DefaultSpinnerDisc.cs | float.Lerp / MathF.Abs and avoid double casts |
| osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinner*.cs | MathF.Abs over Math.Abs in damping calls |
| osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs | Rewrite CirclePosition with MathF |
| osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs | LengthSquared comparisons for spin offset checks |
| osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs | LengthSquared epsilon check; MathF.Atan2 |
| osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointConnection.cs | MathF.Atan2 for rotation |
| osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs, OsuModRandom.cs | MathF for trig/PI |
| osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs | DistanceSquared with precomputed (2r)² (also fixes CI cast) |
| osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs, OsuDistanceSnapProvider.cs, Blueprints/GridPlacementBlueprint.cs | DistanceSquared comparisons |
| osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs | LengthSquared comparison for shorter movement check |
| osu.Game.Rulesets.Catch/Edit/CatchBlueprintContainer.cs, Blueprints/FruitPlacementBlueprint.cs, JuiceStreamPlacementBlueprint.cs | DistanceSquared snap-radius checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MathF.Clamp→float.ClampinParticleSpewer.csMathF.Clamp→float.ClampinSmokeSegment.csdouble→floatimplicit cast inOsuModTargetPractice.cs(target.Radius * 2→(float)target.Radius * 2)