Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server GC mode for fsc.exe #404

Closed
latkin opened this issue May 1, 2015 · 4 comments
Closed

Server GC mode for fsc.exe #404

latkin opened this issue May 1, 2015 · 4 comments

Comments

@latkin
Copy link
Contributor

latkin commented May 1, 2015

I did some testing today, trying out server GC mode on fsc.exe. Results look promising:

Compiler Target Trials Workstation GC Server GC % Improvement
proto debug fsc Debug FSharp.Core.dll 10 17.4 s 15.1 s 13.2%
proto debug fsc Release FSharp.Compiler.dll 3 64.2 s 54.4 s 15.3%
Release NGENed fsc Test area fsharp\core\portable 2 75.3 s 70.5 s 6.4 %
Release NGENed fsc Test tool FSharp.Compiler.Hosted 10 0.903 s 0.705 s 22.0 %

FWIW the Roslyn command-line compilers use server GC.

Potential downsides:

  • On single-core machines, server GC might actually be slower
  • With server mode, GCs are less-frequent but bigger. Result is that process working set gets much larger in between GCs.
  • Server mode gives higher throughput, but worse responsiveness (collections are more intrusive). That's ok for command-line compiler, but we would not want to change it for IDE language service compiler backend.

Note also that we already have GCLatencyMode.Batch enabled now in fsc, which gave us a nice perf boost.

I'll send a PR next week adding this, unless anyone objects.

@dsyme
Copy link
Contributor

dsyme commented May 2, 2015

Well, that looks great :)

@dsyme
Copy link
Contributor

dsyme commented Aug 20, 2022

@vzarytovskii @KevinRansom I'm reopening as I'd like to revalidate whether using gcServer is a perf win or not. On bootstrapping the compiler it gives a noticeable slowdown.

@dsyme
Copy link
Contributor

dsyme commented Aug 20, 2022

I was quite surprised to find out that we use server GC for fsc.exe on .NET Framework which has an ​fsc.exe.config​ with GC Server enabled as well as a few other settings.

You can see this applies in the product here:

​C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fsc.exe.config​

This surprised me. My experiments on compiling-the-compiler show a 30% slowdown with this setting. I think this should never have been re-enabled, despite what's reported above. Either way we need to revalidate this setting.

When we build our .NET 6/7 compiler in artifacts is lays down a ​fsc.dll.config​ with ​​ as well as a couple of other settings. However I don't know if .NET 6/7 even takes any notice of these config files at all

@dsyme
Copy link
Contributor

dsyme commented Aug 20, 2022

Closing in favour of #13739

@dsyme dsyme closed this as completed Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants