Major compiler slowdown due to changes in .NET GC between .NET 7 preview2 and .N...
source link: https://github.com/dotnet/fsharp/issues/13730
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Major compiler slowdown due to changes in .NET GC between .NET 7 preview2 and .NET 7 preview3 #13730
Closed
vzarytovskii opened this issue Aug 19, 2022 · 13 comments
Comments
Member
I've seen reports of this from other people, we should investigate. Can reproduce it roughly every other clean build. Update 1:
Update 2: From the dump, it appears it spends a lot of time here:
|
added the Area-Build Everything related to building F# compiler, tooling and VS extension. label
Member
Author
@auduchinok You've mentioned that you have seen some slowness too, right? |
Contributor
We are seeing this one right now. |
Member
Author
So, judging by the tracing, it is doing something in background (i.e. not completely stuck), but is very slow. |
Member
Yes, it looked like the same place in the tables generation. I've used |
Member
Author
Member
Author
Some experimenting: |
changed the title
Local build is getting stuck in generating parsers
Major compiler slowdown between .NET 7 preview2 and .NET 7 preview3
From discussion with @Maoni0 and @mangod9
|
Repro.
You can modify the settings these compilers are using: To turn off GC regions for .NET 7set COMPLUS_GCName=clrgc.dll To turn on Server GCEdit the appropriate
|
Member
Author
I guess as a temporary resolution, we should switch to old GC (via the runtimeconfig, if possible). |
Contributor
Fascinating, I saw this happen yesterday too when building the compiler with my own built runtime to get SuperPMI collections. |
Contributor
I don't know if this is relevant, but main dominators shown in dotmemory are FSharpLists (they behave like linked lists). My theory is that gen0 budget gets exhausted very quickly and afterwards GC basically keeps scanning all the memory because of huge object graphs. Are regions linked list friendly by the way? Traces show that most GC events are AllocSmall - Gen2 and very rarely AllocSmall - Gen0 I also was curious about working set - workstation GC was really trying to keep it 600megs max on 64 gb ram machine. GC time with GCServer went from 90% to just 8%. But this came with working set increase by 10 times (6 gigs). Also, there were only a few GC collections. I guess this is because there was still much memory left and server GC is not so shy about using it. |
@En3Tho I'd advise against analysing too much at this stage. Whatever else, the GC was handling this application (the F# compiler) beautifully before and it seems to me that simply too much has changed in the GC and much more caution is now needed - in particular there has to be an easy fallback to get the old characteristics, and I'd also question whether region collecting should be on by default. In any case methodologically we just need to focus here on finding a way back to the rock-solid reliable performance we've had for the last 15 years. One relevant factor is that the application turns on Batch mode. @vzarytovskii @KevinRansom You might want to look at turning on ServerGC (or undoing the update to .NET 7 preview 7 back to preview 2) so that we are able to work in this repo
@mangod9 said this isn't possible via runtimeconfig in preview7. Turning server mode on should be possible
|
changed the title
Major compiler slowdown between .NET 7 preview2 and .NET 7 preview3
Major compiler slowdown in .NET GC between .NET 7 preview2 and .NET 7 preview3
changed the title
Major compiler slowdown in .NET GC between .NET 7 preview2 and .NET 7 preview3
Major compiler slowdown due to changes in .NET GC between .NET 7 preview2 and .NET 7 preview3
Contributor
This has been fixed by .NET team |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
Archived in project
No branches or pull requests
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK