ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15k stars 2.21k forks source link

Song select performance really bad after spectating in a multi lobby #29088

Closed bytenekos closed 2 days ago

bytenekos commented 1 month ago

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

Ladwick commented 1 month ago

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.

peppy commented 1 month ago

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.

bytenekos commented 1 month ago

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

peppy commented 1 month ago

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.

bytenekos commented 1 month ago

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

bytenekos commented 1 week ago

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

peppy commented 1 week ago

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.

bytenekos commented 1 week ago

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

Joehuu commented 1 week ago

Can confirm, reopening.

bdach commented 1 week ago

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

bytenekos commented 1 week ago

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

peppy commented 5 days ago

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?

bytenekos commented 4 days ago

I'm on windows 11 23h2

Joehuu commented 4 days ago

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.

peppy commented 4 days ago

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

Joehuu commented 4 days ago

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.

peppy commented 4 days ago

Thanks

peppy commented 3 days ago

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 commented 2 days ago

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

peppy commented 2 days ago

Never mind, fix incoming.