dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.12k stars 4.7k forks source link

Big crossgen2 perf regression in Debug mode #79561

Open agocke opened 1 year ago

agocke commented 1 year ago

Sometime after 47158cc4405595ce66d24c29e71e7ac36b532a9c there was a change that caused crossgen2 to take 5x-25x as long to crossgen itself when in Debug mode.

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
trylek commented 1 year ago

My initial guess is that it's most likely something in debug JIT, I'm not aware of any recent major changes to Crossgen2 proper.

trylek commented 1 year ago

Actually I should double-check when @cshung merged in the hot-cold splitting change, that could theoretically change something in Crossgen2 even though I believe it's off by default, but I think that was checked in about 1-2 months ago, not just three weeks back.

ViktorHofer commented 1 year ago

Noticed that yesterday as well when I built the repository in Debug mode: build.cmd. About two hours were spent just in the Microsoft.NETCore.App.Runtime step (sfxproj) which I believe invokes crossgen2.

agocke commented 1 year ago

@trylek Any progress on this? If you need help I can try to bisect -- and then whatever the change is, I'll revert it until you can investigate.

trylek commented 1 year ago

@agocke - sorry, no progress yet; as it's debug only, I didn't treat it as super high priority. Right now I need to fix a new Crossgen2 bug around function pointers, if you have some automation to make bisection easy without taking up too much of your time, identifying the offending change would be great and it should be pretty obvious where the problem is and what is the appropriate course of action.

steveisok commented 2 months ago

This has survived the bump dance a few times, but I think this is worthwhile for us to look into in 10.