Skip to content

Commit

Permalink
step
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmav committed Sep 24, 2024
2 parents 8102008 + 945d316 commit 1fcdd98
Show file tree
Hide file tree
Showing 19 changed files with 615 additions and 123 deletions.
16 changes: 16 additions & 0 deletions BenchmarkData/BenchmarkData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Benchmark Data

## Windows
[Dev Drive](https://aka.ms/devdrive) is a new evolution of the ReFS filesystem starting in Windows 11 22H2 Oct 2023. It was announced at Microsoft Build 2023, and features significantly faster execution vs. earlier 22H2 ReFS or NTFS along with CoW support and a performance mode for Defender antivirus. More details can be found [here](https://aka.ms/EngMSDevDrive).

Windows benchmarks on various versions of Windows compare `System.IO.File.Copy()` with `CloneFile()`,
50 or more copies/clones of a single source file per measurement, highest performance clone flags and settings.
Defender real-time scanning was disabled in the test directory. See CoWComparisons.cs.

### Benchmark data in reverse temporal order

* Jan 2024 - Windows [Preview Win11 23H2 with copy-on-write implementation built into OS APIs](./Win11_23H2_Jan2024_10.0.26020.1000.md) (with feature flag turned on) - fixes large file clone performance
* Oct 2023 - Windows [Canary Win11 22H2 with early copy-on-write implementation built into OS APIs](./Win11_22H2_Oct2023_10.0.25982.1000.md)
* Oct 2023 - Windows [Win11 22H2 initial Dev Drive release](./Win11_22H2_Oct2023_10.0.22621.2506.md)
* May 2023 - Windows [prerelease Dev Drive](./Win11_22H2_May2023.md)
* Dec 2022 - Windows [Win11 22H2 ReFS](./Win11_22H2_Dec2022_ReFS.md)
55 changes: 55 additions & 0 deletions BenchmarkData/Win11_22H2_Dec2022_ReFS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Benchmark numbers for Windows 22H2 in Dec 2022, using ReFS.

Machine was a physical 8/16-core with NVMe. Disable Write Cache Flush flag = Disabled (OS default). All copies done on files with size set via file extents (no data written).

16MB files are about 35X performance, 1MB at 3.2X, and small sizes at about 1.3X.

## Non-VHD, physical partition on disk on the NVMe disk

| Method | FileSize | Mean | Error | StdDev | Median | Ratio | RatioSD |
|---------- |--------- |-----------:|----------:|----------:|-----------:|------:|--------:|
| File.Copy | 0 | 205.5 us | 8.82 us | 26.01 us | 200.1 us | 1.00 | 0.00 |
| CoW | 0 | 183.7 us | 4.85 us | 14.16 us | 181.9 us | 0.91 | 0.13 |
| | | | | | | | |
| File.Copy | 1 | 307.9 us | 6.69 us | 19.53 us | 306.7 us | 1.00 | 0.00 |
| CoW | 1 | 265.5 us | 15.18 us | 44.77 us | 265.6 us | 0.87 | 0.15 |
| | | | | | | | |
| File.Copy | 1024 | 310.3 us | 6.56 us | 18.82 us | 310.4 us | 1.00 | 0.00 |
| CoW | 1024 | 235.1 us | 9.51 us | 26.82 us | 227.9 us | 0.76 | 0.10 |
| | | | | | | | |
| File.Copy | 16384 | 295.5 us | 5.80 us | 15.39 us | 295.2 us | 1.00 | 0.00 |
| CoW | 16384 | 272.4 us | 16.46 us | 46.96 us | 275.9 us | 0.95 | 0.16 |
| | | | | | | | |
| File.Copy | 262144 | 425.5 us | 9.29 us | 26.80 us | 423.8 us | 1.00 | 0.00 |
| CoW | 262144 | 234.6 us | 7.83 us | 22.96 us | 232.7 us | 0.55 | 0.06 |
| | | | | | | | |
| File.Copy | 1048576 | 851.7 us | 20.00 us | 56.08 us | 836.3 us | 1.00 | 0.00 |
| CoW | 1048576 | 273.7 us | 15.39 us | 45.39 us | 269.9 us | 0.33 | 0.06 |
| | | | | | | | |
| File.Copy | 16777216 | 9,327.9 us | 179.64 us | 206.88 us | 9,282.0 us | 1.00 | 0.00 |
| CoW | 16777216 | 273.3 us | 15.22 us | 44.17 us | 260.5 us | 0.04 | 0.00 |

## VHD formatted empty with ReFS for each iteration

| Method | FileSize | Mean | Error | StdDev | Median | Ratio | RatioSD |
|---------- |--------- |-----------:|----------:|----------:|-----------:|------:|--------:|
| File.Copy | 0 | 202.8 us | 6.79 us | 19.92 us | 199.5 us | 1.00 | 0.00 |
| CoW | 0 | 192.8 us | 5.40 us | 15.57 us | 191.2 us | 0.96 | 0.12 |
| | | | | | | | |
| File.Copy | 1 | 346.8 us | 9.65 us | 27.99 us | 345.8 us | 1.00 | 0.00 |
| CoW | 1 | 237.5 us | 7.38 us | 21.28 us | 239.3 us | 0.69 | 0.08 |
| | | | | | | | |
| File.Copy | 1024 | 372.9 us | 9.75 us | 27.66 us | 371.2 us | 1.00 | 0.00 |
| CoW | 1024 | 248.0 us | 6.97 us | 20.21 us | 248.5 us | 0.67 | 0.07 |
| | | | | | | | |
| File.Copy | 16384 | 347.1 us | 12.56 us | 35.62 us | 342.2 us | 1.00 | 0.00 |
| CoW | 16384 | 248.8 us | 9.76 us | 28.47 us | 244.3 us | 0.72 | 0.11 |
| | | | | | | | |
| File.Copy | 262144 | 484.3 us | 11.83 us | 34.69 us | 482.4 us | 1.00 | 0.00 |
| CoW | 262144 | 247.8 us | 8.51 us | 24.69 us | 245.6 us | 0.51 | 0.06 |
| | | | | | | | |
| File.Copy | 1048576 | 954.4 us | 19.06 us | 41.85 us | 948.0 us | 1.00 | 0.00 |
| CoW | 1048576 | 251.3 us | 9.77 us | 28.64 us | 246.8 us | 0.27 | 0.03 |
| | | | | | | | |
| File.Copy | 16777216 | 9,867.2 us | 195.87 us | 546.01 us | 9,605.5 us | 1.00 | 0.00 |
| CoW | 16777216 | 283.5 us | 6.56 us | 18.60 us | 282.7 us | 0.03 | 0.00 |
30 changes: 30 additions & 0 deletions BenchmarkData/Win11_22H2_May2023.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Benchmark numbers for Dev Drive prerelease in Win11 22H2 Developer channel around the time of Dev Drive announce at Microsoft Build, May 2023.

Machine was a physical 8/16-core with NVMe. Disable Write Cache Flush flag = Disabled (OS default). All copies done on files with size set via file extents (no data written).

CoW links on Dev Drive take approximately constant time except at large file sizes.
The savings is proportional to the file size, with 16MB files at about 31X performance, 1MB at 5.9X, and small sizes at about 2X.
Note that all performance numbers are significantly better than the no-VHD 22H2 measurements in [Win11 22H2 ReFS](./Win11_22H2_Dec2022_ReFS.md), reflecting the Windows Filesystem team's work to reduce overhead for Dev Drive.

| Method | FileSize | Mean | Error | StdDev | Median | Ratio | RatioSD |
|---------- |--------- |-----------:|----------:|----------:|-----------:|------:|--------:|
| File.Copy | 0 | 136.0 us | 3.95 us | 11.57 us | 135.5 us | 1.00 | 0.00 |
| CoW | 0 | 102.9 us | 2.82 us | 8.17 us | 102.3 us | 0.76 | 0.08 |
| | | | | | | | |
| File.Copy | 1 | 305.4 us | 7.50 us | 21.26 us | 305.4 us | 1.00 | 0.00 |
| CoW | 1 | 130.6 us | 3.96 us | 11.16 us | 129.5 us | 0.43 | 0.05 |
| | | | | | | | |
| File.Copy | 1024 | 301.9 us | 6.77 us | 18.98 us | 301.7 us | 1.00 | 0.00 |
| CoW | 1024 | 133.6 us | 3.94 us | 11.49 us | 132.0 us | 0.44 | 0.04 |
| | | | | | | | |
| File.Copy | 16384 | 274.5 us | 6.35 us | 17.92 us | 272.4 us | 1.00 | 0.00 |
| CoW | 16384 | 132.1 us | 3.69 us | 10.75 us | 132.4 us | 0.48 | 0.05 |
| | | | | | | | |
| File.Copy | 262144 | 409.9 us | 8.53 us | 24.34 us | 408.0 us | 1.00 | 0.00 |
| CoW | 262144 | 134.3 us | 5.48 us | 15.74 us | 131.4 us | 0.33 | 0.04 |
| | | | | | | | |
| File.Copy | 1048576 | 774.4 us | 22.11 us | 65.20 us | 757.9 us | 1.00 | 0.00 |
| CoW | 1048576 | 132.7 us | 2.62 us | 6.53 us | 131.2 us | 0.18 | 0.01 |
| | | | | | | | |
| File.Copy | 16777216 | 6,571.5 us | 131.19 us | 239.89 us | 6,520.5 us | 1.00 | 0.00 |
| CoW | 16777216 | 210.3 us | 5.32 us | 15.34 us | 205.2 us | 0.03 | 0.00 |
105 changes: 105 additions & 0 deletions BenchmarkData/Win11_22H2_Oct2023_10.0.22621.2506.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Benchmark numbers for Dev Drive initial release in Win11 22H2 10.0.22621.2506 (late October 2023 with optional Oct 25 OS update).

16-core Azure AMD v5 VM.

ExtentsOnly = Files to be copied/cloned were created only by setting the file extents.
WroteData = Files were also written to. ReFS/Dev Drive behaves differently in this case.

BenchmarkDotNet=v0.13.2, OS=Windows 11 (10.0.22621.2506), VM=Hyper-V
AMD EPYC 7763, 1 CPU, 16 logical and 8 physical cores
.NET SDK=6.0.416
[Host] : .NET 6.0.24 (6.0.2423.51814), X64 RyuJIT AVX2
Job-GPSHJH : .NET 6.0.24 (6.0.2423.51814), X64 RyuJIT AVX2

## Disable Write Cache Flush flag = Enabled

| Method | FileSize | FileContents | Mean | Error | StdDev | Median | Ratio | RatioSD |
|---------- |--------- |------------- |-----------:|---------:|---------:|-----------:|------:|--------:|
| File.Copy | 0 | ExtentsOnly | 179.1 us | 3.58 us | 3.83 us | 177.6 us | 1.00 | 0.00 |
| CoW | 0 | ExtentsOnly | 169.3 us | 3.38 us | 7.34 us | 167.0 us | 0.99 | 0.05 |
| | | | | | | | | |
| File.Copy | 0 | WroteData | 178.4 us | 3.54 us | 5.62 us | 175.8 us | 1.00 | 0.00 |
| CoW | 0 | WroteData | 168.9 us | 3.01 us | 6.08 us | 167.3 us | 0.95 | 0.03 |
| | | | | | | | | |
| File.Copy | 1 | ExtentsOnly | 393.9 us | 6.77 us | 7.52 us | 394.9 us | 1.00 | 0.00 |
| CoW | 1 | ExtentsOnly | 201.4 us | 3.34 us | 2.61 us | 201.1 us | 0.51 | 0.01 |
| | | | | | | | | |
| File.Copy | 1 | WroteData | 384.1 us | 7.68 us | 11.49 us | 384.3 us | 1.00 | 0.00 |
| CoW | 1 | WroteData | 375.7 us | 4.98 us | 4.16 us | 376.3 us | 0.98 | 0.03 |
| | | | | | | | | |
| File.Copy | 1024 | ExtentsOnly | 406.6 us | 7.32 us | 10.96 us | 407.7 us | 1.00 | 0.00 |
| CoW | 1024 | ExtentsOnly | 233.9 us | 4.59 us | 6.43 us | 232.4 us | 0.58 | 0.03 |
| | | | | | | | | |
| File.Copy | 1024 | WroteData | 408.3 us | 8.14 us | 8.00 us | 410.2 us | 1.00 | 0.00 |
| CoW | 1024 | WroteData | 434.6 us | 8.85 us | 25.10 us | 425.6 us | 1.07 | 0.05 |
| | | | | | | | | |
| File.Copy | 16384 | ExtentsOnly | 384.8 us | 6.60 us | 13.18 us | 385.7 us | 1.00 | 0.00 |
| CoW | 16384 | ExtentsOnly | 231.9 us | 4.62 us | 6.48 us | 230.0 us | 0.60 | 0.03 |
| | | | | | | | | |
| File.Copy | 16384 | WroteData | 387.0 us | 7.29 us | 20.07 us | 381.1 us | 1.00 | 0.00 |
| CoW | 16384 | WroteData | 233.9 us | 4.68 us | 6.56 us | 232.6 us | 0.61 | 0.04 |
| | | | | | | | | |
| File.Copy | 262144 | ExtentsOnly | 437.0 us | 8.32 us | 6.94 us | 435.9 us | 1.00 | 0.00 |
| CoW | 262144 | ExtentsOnly | 231.4 us | 4.54 us | 5.41 us | 230.7 us | 0.53 | 0.01 |
| | | | | | | | | |
| File.Copy | 262144 | WroteData | 419.8 us | 7.47 us | 6.23 us | 419.1 us | 1.00 | 0.00 |
| CoW | 262144 | WroteData | 232.7 us | 3.19 us | 6.22 us | 232.1 us | 0.55 | 0.01 |
| | | | | | | | | |
| File.Copy | 1048576 | ExtentsOnly | 630.0 us | 11.96 us | 28.19 us | 617.1 us | 1.00 | 0.00 |
| CoW | 1048576 | ExtentsOnly | 231.7 us | 4.57 us | 5.94 us | 230.1 us | 0.36 | 0.02 |
| | | | | | | | | |
| File.Copy | 1048576 | WroteData | 630.2 us | 12.55 us | 31.49 us | 614.8 us | 1.00 | 0.00 |
| CoW | 1048576 | WroteData | 232.4 us | 4.26 us | 3.56 us | 233.2 us | 0.37 | 0.02 |
| | | | | | | | | |
| File.Copy | 16777216 | ExtentsOnly | 3,419.0 us | 29.44 us | 24.59 us | 3,417.9 us | 1.00 | 0.00 |
| CoW | 16777216 | ExtentsOnly | 253.0 us | 5.03 us | 9.20 us | 250.2 us | 0.08 | 0.00 |
| | | | | | | | | |
| File.Copy | 16777216 | WroteData | 3,486.9 us | 30.07 us | 28.13 us | 3,486.5 us | 1.00 | 0.00 |
| CoW | 16777216 | WroteData | 253.5 us | 3.96 us | 5.92 us | 252.2 us | 0.07 | 0.00 |


## Disable Write Cache Flush flag = Disabled (OS default)

| Method | FileSize | FileContents | Mean | Error | StdDev | Median | Ratio | RatioSD |
|---------- |--------- |------------- |-----------:|---------:|----------:|-----------:|------:|--------:|
| File.Copy | 0 | ExtentsOnly | 183.7 us | 3.59 us | 3.69 us | 182.8 us | 1.00 | 0.00 |
| CoW | 0 | ExtentsOnly | 167.8 us | 3.33 us | 5.84 us | 165.9 us | 0.93 | 0.04 |
| | | | | | | | | |
| File.Copy | 0 | WroteData | 176.6 us | 2.82 us | 3.13 us | 176.1 us | 1.00 | 0.00 |
| CoW | 0 | WroteData | 169.7 us | 3.37 us | 7.04 us | 166.4 us | 1.00 | 0.04 |
| | | | | | | | | |
| File.Copy | 1 | ExtentsOnly | 402.1 us | 11.48 us | 33.86 us | 389.2 us | 1.00 | 0.00 |
| CoW | 1 | ExtentsOnly | 204.1 us | 4.02 us | 6.26 us | 202.5 us | 0.51 | 0.04 |
| | | | | | | | | |
| File.Copy | 1 | WroteData | 397.7 us | 10.40 us | 30.50 us | 386.6 us | 1.00 | 0.00 |
| CoW | 1 | WroteData | 384.4 us | 7.59 us | 8.44 us | 382.2 us | 0.96 | 0.07 |
| | | | | | | | | |
| File.Copy | 1024 | ExtentsOnly | 407.5 us | 8.09 us | 10.81 us | 409.4 us | 1.00 | 0.00 |
| CoW | 1024 | ExtentsOnly | 232.4 us | 3.12 us | 4.77 us | 231.1 us | 0.57 | 0.02 |
| | | | | | | | | |
| File.Copy | 1024 | WroteData | 409.7 us | 7.26 us | 13.46 us | 409.4 us | 1.00 | 0.00 |
| CoW | 1024 | WroteData | 423.8 us | 8.28 us | 11.34 us | 420.6 us | 1.03 | 0.05 |
| | | | | | | | | |
| File.Copy | 16384 | ExtentsOnly | 386.3 us | 6.51 us | 14.55 us | 385.1 us | 1.00 | 0.00 |
| CoW | 16384 | ExtentsOnly | 234.6 us | 4.55 us | 7.36 us | 232.8 us | 0.61 | 0.03 |
| | | | | | | | | |
| File.Copy | 16384 | WroteData | 382.8 us | 7.41 us | 16.73 us | 381.2 us | 1.00 | 0.00 |
| CoW | 16384 | WroteData | 233.3 us | 4.55 us | 6.81 us | 232.8 us | 0.60 | 0.03 |
| | | | | | | | | |
| File.Copy | 262144 | ExtentsOnly | 438.3 us | 9.49 us | 27.69 us | 424.3 us | 1.00 | 0.00 |
| CoW | 262144 | ExtentsOnly | 233.1 us | 4.12 us | 6.41 us | 231.8 us | 0.53 | 0.03 |
| | | | | | | | | |
| File.Copy | 262144 | WroteData | 439.2 us | 10.13 us | 29.70 us | 424.8 us | 1.00 | 0.00 |
| CoW | 262144 | WroteData | 232.6 us | 3.65 us | 5.24 us | 231.6 us | 0.54 | 0.03 |
| | | | | | | | | |
| File.Copy | 1048576 | ExtentsOnly | 634.6 us | 12.69 us | 30.40 us | 626.0 us | 1.00 | 0.00 |
| CoW | 1048576 | ExtentsOnly | 234.7 us | 4.04 us | 6.86 us | 233.2 us | 0.37 | 0.02 |
| | | | | | | | | |
| File.Copy | 1048576 | WroteData | 630.5 us | 12.60 us | 32.97 us | 616.9 us | 1.00 | 0.00 |
| CoW | 1048576 | WroteData | 233.9 us | 4.62 us | 8.34 us | 232.7 us | 0.37 | 0.02 |
| | | | | | | | | |
| File.Copy | 16777216 | ExtentsOnly | 3,496.3 us | 69.08 us | 134.74 us | 3,440.1 us | 1.00 | 0.00 |
| CoW | 16777216 | ExtentsOnly | 250.9 us | 4.04 us | 5.39 us | 249.9 us | 0.07 | 0.00 |
| | | | | | | | | |
| File.Copy | 16777216 | WroteData | 3,575.5 us | 37.86 us | 35.41 us | 3,570.5 us | 1.00 | 0.00 |
| CoW | 16777216 | WroteData | 252.4 us | 3.61 us | 6.69 us | 251.9 us | 0.07 | 0.00 |
Loading

0 comments on commit 1fcdd98

Please sign in to comment.