osu icon indicating copy to clipboard operation
osu copied to clipboard

Song select performance really bad after spectating in a multi lobby

Open bytenekos opened this issue 1 year ago • 6 comments

Type

Performance

Bug description

Stutters when pressing f2 or causing big jumps in beatmap selection (as in going from one end of the beatmap carousel to another) after going into spectator in a multi lobby and exiting

Screenshots or videos

https://github.com/user-attachments/assets/f79245fc-dcde-40cb-b552-9a18671dec2d

https://discord.com/channels/188630481301012481/1097318920991559880/1266115025031004181 https://discord.com/channels/188630481301012481/1097318920991559880/1266112819791925391

Version

2024.726.0-lazer

Logs

compressed-logs.zip

bytenekos avatar Jul 25 '24 19:07 bytenekos

I was about to make an issue for this too, I didn't know exactly it was after spectating but I noticed most times after a multi I would get horrid performance at song select, specially when hitting the random button.

Ladwick avatar Jul 25 '24 19:07 Ladwick

I can't reproduce anything here, and the graphs you are showing aren't really crippling slowdowns either.

I've checked for leaks from multiplayer spectator and cannot find any. I've profiled performance locally and can't get a slowdown large enough to investigate further.

peppy avatar Jul 30 '24 09:07 peppy

I've done a bit more testing and I find it interesting how after exiting spectator and scrolling through beatmaps the gc count (in the ctrl + f2 menu) goes up drastically. No idea if that's at all relevant or if there's maybe something else that's interesting but that's what I noticed at least

Video before entering spectator (fresh start)

https://github.com/user-attachments/assets/54a7f056-d9bf-42a1-8955-3edfab0892b8

Video after entering spectator (same session)

https://github.com/user-attachments/assets/0fd58811-9303-4d04-b825-5dffe7ea6bdf

Was also getting these kinds of messages when trying to exit the multi lobby: image

Some logs with performance-xyz.log stuff:

logs.zip

If you have anything that you'd like me to try out to get more info/have any questions about please lmk because I just don't know what specific info I should provide in cases like these

bytenekos avatar Jul 30 '24 20:07 bytenekos

Once you're in the bad state, can you create a memory dump from task manager (right click on the osu! process) then email it to me? You'll probably need to zip and upload to google drive as it may be quite big.

peppy avatar Jul 31 '24 03:07 peppy

Should be sent now 👌 I've attached the issue number in the subject line

bytenekos avatar Jul 31 '24 10:07 bytenekos

One observation I've noticed is that if you don't have a lot of maps, the stuttering subsides after a few "rounds" around the beatmap carousel and the stutter isn't that bad to begin with. If you have a lot of beatmaps, performance slows down to a crawl (as mentioned in the original issue message).

Osu! 2024.08.27 - 12.56.39.03.webm

bytenekos avatar Aug 27 '24 10:08 bytenekos

There's a fix which will be included in the next release. Please check whether it fixes your issue. If not, please leave a reply here.

peppy avatar Aug 30 '24 07:08 peppy

Tried out the current master (https://github.com/ppy/osu/commit/a09c6e2a25468c46631d1605a687db075ffda0ad) and the issue is still there :( Exact same behavior as my last comment

bytenekos avatar Aug 30 '24 19:08 bytenekos

Can confirm, reopening.

Joehuu avatar Aug 30 '24 21:08 Joehuu

Were you both testing in debug? I'm not sure that is representative of anything if yes.

bdach avatar Aug 31 '24 06:08 bdach

Tested with release and no difference at all. Release, debug and the current release (817.0) have the same behavior.

bytenekos avatar Aug 31 '24 08:08 bytenekos

I've been trying to repro this with a huge beatmap database and still can't...

Confirmation that everyone that is reproing this is on windows?

peppy avatar Sep 02 '24 10:09 peppy

I'm on windows 11 23h2

bytenekos avatar Sep 02 '24 23:09 bytenekos

Also initially tested on Windows 11, but I can also reproduce it on macOS.

I've been trying to repro this with a huge beatmap database and still can't...

That doesn't matter, I think. I only have 744 matches (beatmap difficulties), and can only reproduce if I have the files. Nuking the files, I can't seem to reproduce.

Joehuu avatar Sep 03 '24 01:09 Joehuu

@Joehuu and it's enough to just enter the multiplayer listing once and exit out?

peppy avatar Sep 03 '24 03:09 peppy

No, you have to be in MultiSpectatorScreen and wait until the MultiSpectatorPlayerLoaders push to MultiSpectatorPlayers (i.e. when you see gameplay in spectator). Also want to point out SoloSpectatorPlayer is unaffected by this.

Joehuu avatar Sep 03 '24 03:09 Joehuu

Thanks

peppy avatar Sep 03 '24 03:09 peppy

Able to reproduce. Definitely GC related.

Cycling carousel normally:

JetBrains Rider 2024-09-04 at 06 04 23

Cycling carousel after multiplayer spectator:

JetBrains Rider 2024-09-04 at 06 03 36

Comparing total genX sizes and object counts shows a large but not crippling difference (68.56mb -> 101.90mb managed / 553k -> 824k live objects). First thought was audio adjustments (each screen has muting stuff) so I attempted disabling that but it's still performing horribly.

Will require some further investigation.

peppy avatar Sep 04 '24 06:09 peppy

@Joehuu can you try updating your .NET and reproducing on the latest HEAD? I can't seem to repro anymore...

peppy avatar Sep 05 '24 07:09 peppy

Never mind, fix incoming.

peppy avatar Sep 05 '24 08:09 peppy