-
Notifications
You must be signed in to change notification settings - Fork 832
Enable parallel compilation features by default #18998
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
Conversation
❗ Release notes required
|
|
Can I ignore the other three? |
Yes, we can continue with just this one. |
Type providers don't like parallel imports, another random fail in evil provider. |
I wonder if it because of the |
I suspect it was because of one missing lock 6b96083 |
Yes, the oldest thing I remember was the Reactor, that made everything sequential. But then there's this #10310 |
|
Ok this makes sense, all access to TP synchronized. |
|
I suspect there is still a lot that can be optimized w.r.t. graph creation and how Transparent Compiler caches it. But I feel it would be best to do it separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables parallel compilation features by default after stabilization, including parallel reference resolution, parallel optimizations, parallel ILxGen, and graph-based type checking. The --parallelcompilation- switch can be used to revert to previous behavior. Setting --deterministic also makes compilation sequential except for parallel imports. IL baselines changed due to reordered methods from parallel processing.
Key Changes:
- Enabled parallel compilation by default in configuration and build settings
- Fixed deterministic mode to exclude graph-based type checking
- Improved script handling and signature-to-implementation file mapping in graph checking
- Updated thread safety for type provider disposal
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/FSharp.Build/Microsoft.FSharp.NetSdk.props | Changed ParallelCompilation default to true |
| src/FSharp.Build/Fsc.fs | Changed ParallelCompilation default from false to true |
| src/Compiler/Optimize/Optimizer.fs | Changed default processing mode from Sequential to Parallel |
| src/Compiler/Driver/ParseAndCheckInputs.fs | Added deterministic mode check to exclude graph-based type checking |
| src/Compiler/Driver/GraphChecking/Types.fsi | Added IsScript property and TryGetWrongOrderSignatureToImplementationIndex method |
| src/Compiler/Driver/GraphChecking/Types.fs | Improved file pair mapping logic and added script detection |
| src/Compiler/Driver/GraphChecking/DependencyResolution.fs | Added script compilation handling and wrong-order signature detection |
| src/Compiler/Driver/CompilerOptions.fs | Updated parallel compilation switch to control reference resolution |
| src/Compiler/Driver/CompilerImports.fs | Refactored assembly import to be fully async and fixed thread safety |
| src/Compiler/Driver/CompilerConfig.fs | Changed defaults to enable parallel features |
| docs/release-notes/.FSharp.Compiler.Service/11.0.0.md | Added release notes entry |
| tests/fsharp/typecheck/sigs/neg56_a.bsl | Updated baseline with new error |
| tests/fsharp/typecheck/sigs/neg14.bsl | Updated baseline with reordered errors |
| tests/fsharp/tests.fs | Removed skipped test |
| tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs | Re-enabled previously skipped test |
| Multiple IL baseline files | Updated baselines reflecting method reordering from parallel compilation |
nojaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see another step in the right direction. That said, don’t present this as "everything is now parallel." It needs more transparency and nuance.
|
|
||
| ### Changed | ||
|
|
||
| * Parallel compilation stabilised and enabled by default ([PR #18998](https://github.com/dotnet/fsharp/pull/18998)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite vague about what is actually changed here. Anyone reading this, will need to scour through the PR to know what is actual up.
|
@nojaf thanks for the careful review👍 , I'll do a follow up addressing it. |
This fixes remaining CI failures and enables by default
--parallelcompilation. This includes:--test:ParallelOptimization#14390NOTE: For deterministic builds only parallel reference resolution will be enabled.
--parallelcompilation-switch can be used to revert all of the above to previous behavior.See tracking issue #18989
TODO:
Some il baselines changed because of reordered methods.
This work was encouraged and kindly sponsored by Amplifying F# initiative 🚀