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

Merge main to release/dev17.9 #16506

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/perf-discussions-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
This is just a typed version of [these notes](https://github.com/dotnet/fsharp/issues/16498), generated during perf discussions on summer of 2023. Can be used as a reference point.

---

# Comparisons
- OCaml
- Scala
- C#
- Rust

# Underlying problems
- LOH allocations
- Build does too much for deltas
- GC Gen 2

# Major problems
- Script start up CLI
- Build on Linux & Mac
- Glitches in test discovery
- Edit & test workflow
- Edit & run workflow
- Edit & check workflow
- Unnecessary rebuilds

# Hosted compiler problems
- Stamp overflow
- Non-deterministic
- Memory leaks
- Infinite loops
- Stay resident compiler
- Permission elevation

# Minor problems
- Benchmarking
- Squigglies
- Colorization
- Debug
- Press dot

# Incremental phases
- Incremental parsing file
- Incremental checking file
- Incremental optimization for deltas
- Cascading DLL builds
- Incremental DLL builds
- Incremental ILxGen for deltas
- Incremental assembly generation
- Incremental PDB generation for deltas

# Community guidelines
- Community leadership
- Community enablement for tool performance
- Performance acceptance criteria
- Performance running
- Docs for tooling performance
4 changes: 4 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
* Parser recovers on unfinished record declarations. ([PR #16357](https://github.com/dotnet/fsharp/pull/16357))
* `MutableKeyword` to [SynFieldTrivia](../reference/fsharp-compiler-syntaxtrivia-synfieldtrivia.html) ([PR #16357](https://github.com/dotnet/fsharp/pull/16357))
* Added support for a new parameterless constructor for `CustomOperationAttribute`, which, when applied, will use method name as keyword for custom operation in computation expression builder. ([PR #16475](https://github.com/dotnet/fsharp/pull/16475), part of implementation for [fslang-suggestions/1250](https://github.com/fsharp/fslang-suggestions/issues/1250))

### Changed

* Speed up unused opens handling for empty results. ([PR #16502](https://github.com/dotnet/fsharp/pull/16502))
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24053.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24055.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>5f670e45d060b25d5b07646dfcd94eae31893191</Sha>
<Sha>ef691e3c401949dab9986a50d8288a6e489f72bb</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.7.0-preview-23217-02">
Expand Down
19 changes: 13 additions & 6 deletions src/Compiler/Service/ServiceAnalysis.fs
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,19 @@ module UnusedOpens =
/// Async to allow cancellation.
let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async<range list> =
async {
let! ct = Async.CancellationToken
let symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile(ct)
let symbolUses = filterSymbolUses getSourceLineStr symbolUses
let symbolUses = splitSymbolUses symbolUses
let openStatements = getOpenStatements checkFileResults.OpenDeclarations
return! filterOpenStatements symbolUses openStatements
if checkFileResults.OpenDeclarations.Length = 0 then
return []
else
let! ct = Async.CancellationToken
let symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile(ct)
let symbolUses = filterSymbolUses getSourceLineStr symbolUses
let symbolUses = splitSymbolUses symbolUses
let openStatements = getOpenStatements checkFileResults.OpenDeclarations

if openStatements.Length = 0 then
return []
else
return! filterOpenStatements symbolUses openStatements
}

module SimplifyNames =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DotNetBuildOffline>true</DotNetBuildOffline>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DotNetBuildOffline>true</DotNetBuildOffline>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<OtherFlags>--standalone</OtherFlags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ type NoFileSystemCheckerBenchmark() =
let mutable benchmark : ProjectWorkflowBuilder = Unchecked.defaultof<_>

[<ParamsAllValues>]
member val UseGetSource = true with get,set

[<ParamsAllValues>]
member val UseChangeNotifications = true with get,set
member val UseInMemoryDocuments = true with get,set

[<ParamsAllValues>]
member val EmptyCache = true with get,set
Expand All @@ -165,8 +162,8 @@ type NoFileSystemCheckerBenchmark() =
benchmark <-
ProjectWorkflowBuilder(
project,
useGetSource = this.UseGetSource,
useChangeNotifications = this.UseChangeNotifications).CreateBenchmarkBuilder()
useGetSource = this.UseInMemoryDocuments,
useChangeNotifications = this.UseInMemoryDocuments).CreateBenchmarkBuilder()

[<IterationSetup>]
member this.EditFirstFile_OnlyInternalChange() =
Expand All @@ -178,15 +175,14 @@ type NoFileSystemCheckerBenchmark() =
member this.ExampleWorkflow() =

use _ = Activity.start "Benchmark" [
"UseGetSource", this.UseGetSource.ToString()
"UseChangeNotifications", this.UseChangeNotifications.ToString()
"UseInMemoryDocuments", this.UseInMemoryDocuments.ToString()
]

let first = "File001"
let middle = $"File%03d{size / 2}"
let last = $"File%03d{size}"

if this.UseGetSource && this.UseChangeNotifications then
if this.UseInMemoryDocuments then

benchmark {
updateFile first updatePublicSurface
Expand Down
Loading