Skip to content
Closed
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
10 changes: 5 additions & 5 deletions .azuredevops/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 2
# Disabling dependabot on Azure DevOps as this is a mirrored repo. Updates should go through github.
enable-campaigned-updates: false
enable-security-updates: false
version: 2

# Disabling dependabot on Azure DevOps as this is a mirrored repo. Updates should go through github.
enable-campaigned-updates: false
enable-security-updates: false
60 changes: 60 additions & 0 deletions TestFinal/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
open System
open Microsoft.FSharp.Collections

[<CustomEquality; CustomComparison>]
type Element =
{ Id: int; Version: string }
interface IComparable with
member x.CompareTo(obj) =
match obj with
| :? Element as other -> compare x.Id other.Id
| _ -> -1
override x.Equals(obj) =
match obj with
| :? Element as other -> x.Id = other.Id
| _ -> false
override x.GetHashCode() = hash x.Id

let oldIntersect (a: Set<'T>) (b: Set<'T>) =
a |> Set.filter (fun item -> b.Contains item)

let cleanGC () =
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()

let measure f iterations =
let sw = Diagnostics.Stopwatch.StartNew()
for _ in 1 .. iterations do ignore (f())
sw.Stop()
float sw.Elapsed.TotalMilliseconds / float iterations

let run name (a: Set<Element>) (b: Set<Element>) =
printf "Benchmarking %-25s... " name
cleanGC()
let oldTime = measure (fun () -> oldIntersect a b) 5
cleanGC()
let newTime = measure (fun () -> Set.intersect a b) 5
let result = Set.intersect a b
let idOk = if not result.IsEmpty then (result.MinimumElement).Version = "FromA" else true
printfn "Done"
(name, oldTime, newTime, (oldTime/newTime), idOk)

printfn "Generating Data..."
let hA = Set.ofSeq (seq { for i in 1 .. 1_000_000 -> { Id = i; Version = "FromA" } })
let hB = Set.ofSeq (seq { for i in 1 .. 1_000_000 -> { Id = i; Version = "FromB" } })
let tB = Set.ofSeq (seq { for i in 1 .. 10 -> { Id = i; Version = "FromB" } })
let tA = Set.ofSeq (seq { for i in 1 .. 10 -> { Id = i; Version = "FromA" } })

let res = [
run "Huge(a) ∩ Tiny(b)" hA tB
run "Tiny(a) ∩ Huge(b)" tA hB
run "Huge(a) ∩ Huge(b)" hA hB
]

printfn "\n%-25s | %12s | %12s | %8s | %s" "Scenario" "Old (Actual)" "New (Actual)" "Speedup" "Identity OK"
printfn "%s" (String.replicate 85 "-")
for (n, o, nw, s, i) in res do
printfn "%-25s | %10.4f ms | %10.4f ms | %7.2fx | %11b" n o nw s i

printfn "\nAssembly: %s" (typeof<Set<int>>.Assembly.Location)
19 changes: 19 additions & 0 deletions TestFinal/TestFinal.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>../artifacts/bin/FSharp.Core/Debug/netstandard2.0/FSharp.Core.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
27 changes: 0 additions & 27 deletions docs/release-notes/.FSharp.Compiler.Service/10.0.200.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/release-notes/.FSharp.Core/10.0.300.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

* Optimize Set.intersect performance symmetry and preserve identity from the first set argument. ([PR #19291](https://github.com/dotnet/fsharp/pull/19291)) (Fixes #19139)
28 changes: 14 additions & 14 deletions docs/release-notes/.FSharp.Core/9.0.200.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Fixed
* Fix exception on Post after MailboxProcessor was disposed ([Issue #17849](https://github.com/dotnet/fsharp/issues/17849), [PR #17922](https://github.com/dotnet/fsharp/pull/17922))
* Fix missing null annotation in Async.SwitchToContext ([Issue #18055](https://github.com/dotnet/fsharp/issues/18055), [PR #18059](https://github.com/dotnet/fsharp/pull/18059))
### Added
### Changed
* String function changed to guarantee a non-null string return type ([PR #17809](https://github.com/dotnet/fsharp/pull/17809))
* Add Parameters as valid target for the Struct attribute ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098))
### Breaking Changes
### Fixed

* Fix exception on Post after MailboxProcessor was disposed ([Issue #17849](https://github.com/dotnet/fsharp/issues/17849), [PR #17922](https://github.com/dotnet/fsharp/pull/17922))
* Fix missing null annotation in Async.SwitchToContext ([Issue #18055](https://github.com/dotnet/fsharp/issues/18055), [PR #18059](https://github.com/dotnet/fsharp/pull/18059))

### Added

### Changed

* String function changed to guarantee a non-null string return type ([PR #17809](https://github.com/dotnet/fsharp/pull/17809))
* Add Parameters as valid target for the Struct attribute ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098))


### Breaking Changes
Loading
Loading