-
Notifications
You must be signed in to change notification settings - Fork 810
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
F# compiler is really slow when trying to compile .net8.0 project with SDK 8.0.303 #17501
Comments
So, the bad news is that I can't reproduce it on my mac, on both TL;DR of the issue is: around .NET7 BCL rolled out "Static abstracts in interfaces" feature (which led to much bigger interfaces hirearchy), at the same time we rolled out support for static abstracts as well as some changes to SRTPs. And what I think is happening is that once you introduce new BCL, some of the functionality in your tests is making typechecking go brrr, and performance degrades significantly, see discussion in the issue above, as well as Don's comment in fsharp/fslang-design@71cd2e0. Conclusion: with all this in mind, the the best current course of action (for us or contributors) would be to:
As a temporary workaround(s), there were some comments from @gusty in the original issue in Fleece, which might help. |
The worst part is that the more people will move to |
I will experiment with caching stuff more once I'm off of work. |
Is it possible to link the changes that fixes this issue? |
#17668 it didn't link for some reason |
Is there an ETA on this? Has been bugging me for months and makes working in some repositories pretty much impossible. |
It will be released with 9.0.200 in January, but will be under |
Is this also going to be backported to 8.0? We compile all our repositories with the .NET 8 SDK due to this issue. |
It will be up to the team. @T-Gro, @KevinRansom thoughts? |
Can you elaborate please? Are you encountering the same/similar between NET8 and NET9 ? We would definitely appreciate your support in identifying a problem which prevents you from building using .NET9 SDK. |
We could probably use .NET 9 for our builds if we absolutely had to, I'm not aware of any current incompatibilities like with 6 and 7. But back when .NET 7 was released we had to force the build system in dozens of repositories to .NET 6. Now with the phasing out of .NET 6 we thought it'd be a good idea to keep using the LTS version of the SDK to be resilient against any issues that might arise with the .NET 9 SDK. Also seeing that the issue has never been addressed made us a bit cautious. So in short, we opt to use the .NET 8 to be on the safe side. But I think that's beside the point anyway. I'd expect a major regression like this one to be fixed in the current LTS version. |
For this bug, it's has not been a regression of the compiler - it was a consequence of many interface layers added to numeric types in NET. The cache has been added as a brand new feature, even under the language version flag for langversion=preview and NET10 eventually. In general, we are not backporting preview language features into older versions of the language. I do understand the desire, but a manually cherry-picked migration of this feature into NET8 SDK, pretending this is a NET8 feature and not a preview feature, would only add more risks. It would also slow down fixes in this area due to inability to automatically backport changes once a conflict like this would be created. |
There is some urgency about this for F#. Being unusably slow compiling and providing intellisense for dotnet8 and dotnet9 isn't an acceptable situation. dotnet8 and dotnet9 are the only supported versions of dotnet. Once it's fixed (in both compilation and tooling) it needs fix dotnet9 compilation without the need to set preview flags. For every developer that discovers the preview flag there will be 10 that don't and end up with a terrible experience of using F#. Our team is lucky because we have a lot of things that are or can be netstandard. But again, few teams will know that that is a workaround (and we didn't and had a bad experience for several months after moving to net8/net9 - we assumed it as a bad VS update). |
Well, i totally understand backporting larger fixes is problematic, but i second @charlesroddie and i just want to underline the importance of "trustworthy" LTS versions, especially important for people working in larger ecosystems. That said, I'm a long term F# advocate and pushed technologies towards F# in various companies. I'm using it for teaching, and my company of course also is mostly F#. I see that there are technical stories behind it but from a user perspective going from already slow 24s for a particular project to 76 is a bummer (and users would actually identify it as a regression not caring about technical side). It does not sound like this severe but it is. Arguing for F# with its slow compiler is already hard enough - going to 76 is a huge one. Slow intellisense is so frustrating for new users also. With a large ecosystem and libraries (not just apps), such things take for a long time to clear out, e.g. this one, quite mild will be a trap for users for months until all libraries and examples get fixed. |
Maybe we could assemble a set of "hard-to-compile" real-world files/projects (if appreciated). Maybe this could be part of a performance test suite @hyazinthh @krauthaufen @luithefirst |
IIRC Vlad did a fix for this but enabling it in tooling depends on this #18190 |
Indeed, this is now only implemented for standalone CLI compilation. This regression was particularly difficult to spot because it came "from the side" by the @haraldsteinlechner: I have a dream of having a suite of pluggable compiler-CI extensions, ideally just a list of triplets: repo url, commit hash (can be updated on demand), and a build+test script to run. Designed exactly for spotting compiler regressions for popular/important/"special" libraries in the ecosystem. |
@T-Gro you should talk to Jared about his complog tool. I think Roslyn uses it in part to make it easy to extract out these kind of calls into something that can be independently tested across versions. |
@T-Gro thanks for clarification and the great work. Yes i will set something up! |
Repro steps
Provide the steps required to reproduce the problem:
dotnet build -v:n .\tests\OpenTK.Tests\OpenTK.Tests.fsproj
Expected behavior
The compiler should compile the project (this particular commit has a runtime error, but that shouldn't matter).
Actual behavior
The compiler never finishes compiling the project.
Known workarounds
Switching to
.net6.0
fixes the issue.Related information
I also tried targeting and compiling the project with SDK Version: 9.0.100-preview.6.24328.19 and I still get the hang.
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: