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

Optimize diffing #1097

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Optimize diffing #1097

wants to merge 4 commits into from

Conversation

kerams
Copy link
Contributor

@kerams kerams commented Jan 18, 2025

Taking advantage of the fact that the compiler can deduplicate struct DU case fields with the same name and type.

Before

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2894)
AMD Ryzen 9 7900, 1 CPU, 24 logical and 12 physical cores
.NET SDK 9.0.200-preview.0.24575.35
  [Host]     : .NET 9.0.1 (9.0.124.61010), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI DEBUG
  DefaultJob : .NET 9.0.1 (9.0.124.61010), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method depth boxed Mean Error StdDev Gen0 Gen1 Gen2 Allocated
ProcessIncrements 15 False 464.0 ms 7.97 ms 9.18 ms 14000.0000 11000.0000 1000.0000 215.61 MB
ProcessIncrements 15 True 598.1 ms 11.63 ms 12.45 ms 18000.0000 16000.0000 1000.0000 282.03 MB
Method depth Mean Error StdDev Gen0 Gen1 Gen2 Allocated
ProcessMessages 10 64.84 ms 0.981 ms 0.917 ms 3250.0000 500.0000 375.0000 53.4 MB
ProcessMessages 15 979.75 ms 19.593 ms 18.327 ms 38000.0000 36000.0000 1000.0000 594.07 MB
CreateWidgets 10 180.9 μs 2.07 μs 1.83 μs 27.3438 22.2168 - 448.23 KB
CreateWidgets 20 67,747.6 μs 1,327.79 μs 1,861.37 μs 4125.0000 4000.0000 750.0000 55342.1 KB

After

Method depth boxed Mean Error StdDev Gen0 Gen1 Gen2 Allocated
ProcessIncrements 15 False 350.1 ms 4.86 ms 4.31 ms 14000.0000 11000.0000 1000.0000 215.61 MB
ProcessIncrements 15 True 516.6 ms 10.31 ms 15.43 ms 18000.0000 16000.0000 1000.0000 282.03 MB
Method depth Mean Error StdDev Gen0 Gen1 Gen2 Allocated
ProcessMessages 10 56.67 ms 0.833 ms 0.779 ms 3300.0000 500.0000 400.0000 53.4 MB
ProcessMessages 15 891.50 ms 17.655 ms 20.332 ms 38000.0000 36000.0000 1000.0000 594.07 MB
CreateWidgets 10 178.3 μs 1.42 μs 1.11 μs 27.3438 22.2168 - 448.23 KB
CreateWidgets 20 68,374.6 μs 1,348.72 μs 2,099.80 μs 4125.0000 4000.0000 750.0000 55342.09 KB

<ItemGroup>
<PackageVersion Include="FsCheck.NUnit" Version="2.16.4" />
<PackageVersion Include="FSharp.Core" Version="7.0.0" />
<PackageVersion Include="FSharp.Core" Version="9.0.101" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just affects test & bench. The Fabulous project is still pinned to 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant