-
Notifications
You must be signed in to change notification settings - Fork 787
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
VS 2022 Preview - Startup time for CoreClr compiler slower than desktop #11907
Comments
// cc @KevinRansom @jonsequitur |
Hm, that's interesting. Did you manage to see which part is taking more time? Do we know if it's actually fsc, or something before? Edit: I mean, can it be msbuild or something? CoreCLR also uses crossgen, right? |
It's not msbuild. It's simply that the JIT is taking longer on the CoreClr. For FSharp.Compiler.Private.dll, the desktop JIT took 0.5ms, where as the CoreClr JIT took 439ms. |
I think we may not have cross-gen enabled in the SDK; we may have to do this -> https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run // cc @brettfo |
Yes ... there is a steep performance degrade between desktop and coreclr: The following shows --times for exactly the same inputs between desktop and coreclr for dotnet 6 and 5.05
|
The shipped binary has been compiled with cross-gen: We build IL only, note the flag: IL Only
When shipped it has been transformed by crossgen to IL Library:
|
@jkotas , Thanks Kevin |
I have done a sanity check back to 2.1 and the behavior seems similar, so at least it's not a regression. |
@mangod9 Could your team please take a look? |
cc @dotnet/crossgen-contrib. @TIHan @KevinRansom is there a standalone repro you can share ? Also would be good to know what tooling you are using to crossgen the assemblies. |
Do you know how many functions you have with tail. prefixes in them? Currently any such function will be skipped during crossgen. I'd be curious to see if dotnet/runtime#56669 has an effect on x64 Windows (it should allow a significant fraction of these functions to be crossgenned). |
@jakobbotsch - We emit 'tail' prefix pretty frequently; basically any function call that could be tail recursive we emit the prefix. That's not entirely true for every single function, but it's mostly true. |
This has been identified as being an issue with crossgen, the coreclr team have done some stellar work and improved the amount of .tailcalls that get crossgened. Their PR is here: dotnet/runtime#56669 We will close this issue. And add a tracking issue to identify further issues once 56669 is available |
We recently switched to using the CoreClr compiler for builds in VS instead of the desktop compiler. Doing so, we regressed compile-time performance.
TFM: net5
CoreClr compiler: 1326 ms Fsc 1 calls
Desktop compiler: 586 ms Fsc 1 calls
It's over double the cost.
This is basically the startup time; I imagine the compiler doesn't actually perform worse on the CoreClr. However, this can be surprising for users as the additional 740ms build-cost per project will add up.
The text was updated successfully, but these errors were encountered: