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

SepReader: Optimize MoveNextAsync #245

Merged
merged 8 commits into from
Jan 28, 2025
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
358 changes: 179 additions & 179 deletions README.md

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions benchmarks/AMD.EPYC.7763/FloatsReaderBench.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.100
[Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-GAKWOE : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-XDFYGT : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0 Toolchain=net90
InvocationCount=Default IterationTime=350ms MaxIterationCount=15
Expand All @@ -13,18 +13,18 @@ MinIterationCount=5 WarmupCount=6 Reader=String
```
| Method | Scope | Rows | Mean | Ratio | MB | MB/s | ns/row | Allocated | Alloc Ratio |
|---------- |------- |------ |-----------:|------:|---:|-------:|-------:|------------:|------------:|
| Sep______ | Row | 25000 | 2.907 ms | 1.00 | 20 | 6973.1 | 116.3 | 1.26 KB | 1.00 |
| Sylvan___ | Row | 25000 | 3.429 ms | 1.18 | 20 | 5911.7 | 137.2 | 10.71 KB | 8.51 |
| ReadLine_ | Row | 25000 | 18.876 ms | 6.49 | 20 | 1074.0 | 755.0 | 73489.67 KB | 58,426.57 |
| CsvHelper | Row | 25000 | 37.064 ms | 12.75 | 20 | 546.9 | 1482.6 | 20.06 KB | 15.95 |
| Sep______ | Row | 25000 | 2.913 ms | 1.00 | 20 | 6958.5 | 116.5 | 1.26 KB | 1.00 |
| Sylvan___ | Row | 25000 | 3.566 ms | 1.22 | 20 | 5685.3 | 142.6 | 10.71 KB | 8.51 |
| ReadLine_ | Row | 25000 | 18.192 ms | 6.24 | 20 | 1114.3 | 727.7 | 73489.7 KB | 58,426.60 |
| CsvHelper | Row | 25000 | 38.233 ms | 13.12 | 20 | 530.2 | 1529.3 | 20.06 KB | 15.95 |
| | | | | | | | | | |
| Sep______ | Cols | 25000 | 3.901 ms | 1.00 | 20 | 5196.8 | 156.0 | 1.26 KB | 1.00 |
| Sylvan___ | Cols | 25000 | 5.854 ms | 1.50 | 20 | 3463.1 | 234.2 | 10.72 KB | 8.51 |
| ReadLine_ | Cols | 25000 | 19.260 ms | 4.94 | 20 | 1052.5 | 770.4 | 73489.62 KB | 58,335.95 |
| CsvHelper | Cols | 25000 | 40.847 ms | 10.47 | 20 | 496.3 | 1633.9 | 21340.29 KB | 16,939.89 |
| Sep______ | Cols | 25000 | 3.950 ms | 1.00 | 20 | 5131.9 | 158.0 | 1.26 KB | 1.00 |
| Sylvan___ | Cols | 25000 | 5.911 ms | 1.50 | 20 | 3429.6 | 236.4 | 10.72 KB | 8.48 |
| ReadLine_ | Cols | 25000 | 19.574 ms | 4.96 | 20 | 1035.6 | 783.0 | 73489.68 KB | 58,155.66 |
| CsvHelper | Cols | 25000 | 41.031 ms | 10.39 | 20 | 494.1 | 1641.3 | 21340.29 KB | 16,887.53 |
| | | | | | | | | | |
| Sep______ | Floats | 25000 | 31.152 ms | 1.00 | 20 | 650.7 | 1246.1 | 8.12 KB | 1.00 |
| Sep_MT___ | Floats | 25000 | 12.662 ms | 0.41 | 20 | 1601.1 | 506.5 | 68.38 KB | 8.43 |
| Sylvan___ | Floats | 25000 | 83.543 ms | 2.68 | 20 | 242.7 | 3341.7 | 19.89 KB | 2.45 |
| ReadLine_ | Floats | 25000 | 112.030 ms | 3.60 | 20 | 181.0 | 4481.2 | 73496.21 KB | 9,055.48 |
| CsvHelper | Floats | 25000 | 161.410 ms | 5.18 | 20 | 125.6 | 6456.4 | 22062.53 KB | 2,718.33 |
| Sep______ | Floats | 25000 | 31.469 ms | 1.00 | 20 | 644.2 | 1258.7 | 8.08 KB | 1.00 |
| Sep_MT___ | Floats | 25000 | 12.639 ms | 0.40 | 20 | 1604.0 | 505.5 | 67.81 KB | 8.40 |
| Sylvan___ | Floats | 25000 | 84.199 ms | 2.68 | 20 | 240.8 | 3368.0 | 19.89 KB | 2.46 |
| ReadLine_ | Floats | 25000 | 112.934 ms | 3.59 | 20 | 179.5 | 4517.4 | 73493.2 KB | 9,101.10 |
| CsvHelper | Floats | 25000 | 161.035 ms | 5.12 | 20 | 125.9 | 6441.4 | 22062.53 KB | 2,732.14 |
24 changes: 12 additions & 12 deletions benchmarks/AMD.EPYC.7763/PackageAssetsBench-GcServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.100
[Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-OIQWSK : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-CZUNEQ : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

Job=Job-OIQWSK EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Job=Job-CZUNEQ EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Server=True Toolchain=net90 InvocationCount=Default
IterationTime=350ms MaxIterationCount=15 MinIterationCount=5
WarmupCount=6 Quotes=False Reader=String

```
| Method | Scope | Rows | Mean | Ratio | MB | MB/s | ns/row | Allocated | Alloc Ratio |
|---------- |------ |-------- |------------:|------:|----:|-------:|-------:|-----------:|------------:|
| Sep______ | Asset | 50000 | 33.42 ms | 1.00 | 29 | 870.2 | 668.5 | 13.48 MB | 1.00 |
| Sep_MT___ | Asset | 50000 | 16.68 ms | 0.50 | 29 | 1743.4 | 333.7 | 13.54 MB | 1.00 |
| Sylvan___ | Asset | 50000 | 44.87 ms | 1.34 | 29 | 648.2 | 897.5 | 13.63 MB | 1.01 |
| ReadLine_ | Asset | 50000 | 59.76 ms | 1.79 | 29 | 486.7 | 1195.3 | 99.74 MB | 7.40 |
| CsvHelper | Asset | 50000 | 120.26 ms | 3.60 | 29 | 241.9 | 2405.3 | 13.64 MB | 1.01 |
| Sep______ | Asset | 50000 | 33.15 ms | 1.00 | 29 | 877.3 | 663.0 | 13.48 MB | 1.00 |
| Sep_MT___ | Asset | 50000 | 16.87 ms | 0.51 | 29 | 1724.3 | 337.4 | 13.55 MB | 1.01 |
| Sylvan___ | Asset | 50000 | 45.40 ms | 1.37 | 29 | 640.6 | 908.1 | 13.63 MB | 1.01 |
| ReadLine_ | Asset | 50000 | 62.51 ms | 1.89 | 29 | 465.3 | 1250.2 | 99.74 MB | 7.40 |
| CsvHelper | Asset | 50000 | 120.39 ms | 3.63 | 29 | 241.6 | 2407.7 | 13.64 MB | 1.01 |
| | | | | | | | | | |
| Sep______ | Asset | 1000000 | 660.38 ms | 1.00 | 581 | 881.1 | 660.4 | 260.41 MB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 344.48 ms | 0.52 | 581 | 1689.1 | 344.5 | 268.84 MB | 1.03 |
| Sylvan___ | Asset | 1000000 | 886.35 ms | 1.34 | 581 | 656.5 | 886.4 | 260.57 MB | 1.00 |
| ReadLine_ | Asset | 1000000 | 1,282.45 ms | 1.94 | 581 | 453.7 | 1282.5 | 1991.05 MB | 7.65 |
| CsvHelper | Asset | 1000000 | 2,464.45 ms | 3.73 | 581 | 236.1 | 2464.4 | 260.58 MB | 1.00 |
| Sep______ | Asset | 1000000 | 680.86 ms | 1.00 | 581 | 854.6 | 680.9 | 260.41 MB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 346.45 ms | 0.51 | 581 | 1679.5 | 346.5 | 268.56 MB | 1.03 |
| Sylvan___ | Asset | 1000000 | 888.66 ms | 1.31 | 581 | 654.8 | 888.7 | 260.58 MB | 1.00 |
| ReadLine_ | Asset | 1000000 | 1,267.46 ms | 1.86 | 581 | 459.1 | 1267.5 | 1991.05 MB | 7.65 |
| CsvHelper | Asset | 1000000 | 2,478.49 ms | 3.64 | 581 | 234.8 | 2478.5 | 260.58 MB | 1.00 |
56 changes: 28 additions & 28 deletions benchmarks/AMD.EPYC.7763/PackageAssetsBench.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.100
[Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-GAKWOE : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-XDFYGT : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

Job=Job-GAKWOE EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Job=Job-XDFYGT EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Toolchain=net90 InvocationCount=Default IterationTime=350ms
MaxIterationCount=15 MinIterationCount=5 WarmupCount=6
Quotes=False Reader=String

```
| Method | Scope | Rows | Mean | Ratio | MB | MB/s | ns/row | Allocated | Alloc Ratio |
|------------- |------ |-------- |-------------:|------:|----:|-------:|-------:|--------------:|------------:|
| Sep______ | Row | 50000 | 3.534 ms | 1.00 | 29 | 8230.8 | 70.7 | 1.02 KB | 1.00 |
| Sep_Async | Row | 50000 | 4.208 ms | 1.19 | 29 | 6911.2 | 84.2 | 1.03 KB | 1.00 |
| Sep_Unescape | Row | 50000 | 3.486 ms | 0.99 | 29 | 8343.7 | 69.7 | 1.02 KB | 1.00 |
| Sylvan___ | Row | 50000 | 4.441 ms | 1.26 | 29 | 6548.8 | 88.8 | 7.67 KB | 7.48 |
| ReadLine_ | Row | 50000 | 21.936 ms | 6.21 | 29 | 1325.9 | 438.7 | 88608.3 KB | 86,496.56 |
| CsvHelper | Row | 50000 | 63.529 ms | 17.98 | 29 | 457.8 | 1270.6 | 20.12 KB | 19.64 |
| | | | | | | | | | |
| Sep______ | Cols | 50000 | 4.834 ms | 1.00 | 29 | 6016.6 | 96.7 | 1.03 KB | 1.00 |
| Sep_Unescape | Cols | 50000 | 5.628 ms | 1.16 | 29 | 5168.0 | 112.6 | 1.04 KB | 1.00 |
| Sylvan___ | Cols | 50000 | 8.516 ms | 1.76 | 29 | 3415.3 | 170.3 | 7.68 KB | 7.44 |
| ReadLine_ | Cols | 50000 | 22.506 ms | 4.66 | 29 | 1292.4 | 450.1 | 88608.29 KB | 85,841.90 |
| CsvHelper | Cols | 50000 | 110.650 ms | 22.89 | 29 | 262.9 | 2213.0 | 445.93 KB | 432.01 |
| | | | | | | | | | |
| Sep______ | Asset | 50000 | 40.183 ms | 1.00 | 29 | 723.8 | 803.7 | 13803.91 KB | 1.00 |
| Sep_MT___ | Asset | 50000 | 24.942 ms | 0.62 | 29 | 1166.1 | 498.8 | 13852.97 KB | 1.00 |
| Sylvan___ | Asset | 50000 | 50.632 ms | 1.26 | 29 | 574.5 | 1012.6 | 13962.27 KB | 1.01 |
| ReadLine_ | Asset | 50000 | 125.355 ms | 3.12 | 29 | 232.0 | 2507.1 | 102134.79 KB | 7.40 |
| CsvHelper | Asset | 50000 | 126.403 ms | 3.15 | 29 | 230.1 | 2528.1 | 13971 KB | 1.01 |
| | | | | | | | | | |
| Sep______ | Asset | 1000000 | 826.839 ms | 1.00 | 581 | 703.7 | 826.8 | 266670.12 KB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 508.723 ms | 0.62 | 581 | 1143.8 | 508.7 | 277744.1 KB | 1.04 |
| Sylvan___ | Asset | 1000000 | 1,021.667 ms | 1.24 | 581 | 569.5 | 1021.7 | 266838.41 KB | 1.00 |
| ReadLine_ | Asset | 1000000 | 2,526.808 ms | 3.06 | 581 | 230.3 | 2526.8 | 2038849.63 KB | 7.65 |
| CsvHelper | Asset | 1000000 | 2,575.298 ms | 3.11 | 581 | 225.9 | 2575.3 | 266846.34 KB | 1.00 |
| Method | Scope | Rows | Mean | Ratio | MB | MB/s | ns/row | Allocated | Alloc Ratio |
|------------- |------ |-------- |-------------:|------:|----:|-------:|-------:|-------------:|------------:|
| Sep______ | Row | 50000 | 3.427 ms | 1.00 | 29 | 8487.1 | 68.5 | 1.02 KB | 1.00 |
| Sep_Async | Row | 50000 | 3.656 ms | 1.07 | 29 | 7954.9 | 73.1 | 1.03 KB | 1.00 |
| Sep_Unescape | Row | 50000 | 3.473 ms | 1.01 | 29 | 8376.0 | 69.5 | 1.15 KB | 1.12 |
| Sylvan___ | Row | 50000 | 4.429 ms | 1.29 | 29 | 6567.1 | 88.6 | 7.67 KB | 7.48 |
| ReadLine_ | Row | 50000 | 21.587 ms | 6.30 | 29 | 1347.4 | 431.7 | 88608.3 KB | 86,496.57 |
| CsvHelper | Row | 50000 | 63.743 ms | 18.60 | 29 | 456.3 | 1274.9 | 20.12 KB | 19.64 |
| | | | | | | | | | |
| Sep______ | Cols | 50000 | 4.758 ms | 1.00 | 29 | 6112.5 | 95.2 | 1.04 KB | 1.00 |
| Sep_Unescape | Cols | 50000 | 5.691 ms | 1.20 | 29 | 5110.7 | 113.8 | 1.04 KB | 1.00 |
| Sylvan___ | Cols | 50000 | 8.204 ms | 1.72 | 29 | 3545.5 | 164.1 | 7.68 KB | 7.42 |
| ReadLine_ | Cols | 50000 | 22.823 ms | 4.80 | 29 | 1274.4 | 456.5 | 88608.31 KB | 85,518.30 |
| CsvHelper | Cols | 50000 | 110.312 ms | 23.18 | 29 | 263.7 | 2206.2 | 445.93 KB | 430.38 |
| | | | | | | | | | |
| Sep______ | Asset | 50000 | 39.731 ms | 1.00 | 29 | 732.1 | 794.6 | 13803.91 KB | 1.00 |
| Sep_MT___ | Asset | 50000 | 28.730 ms | 0.72 | 29 | 1012.4 | 574.6 | 13858.99 KB | 1.00 |
| Sylvan___ | Asset | 50000 | 50.605 ms | 1.28 | 29 | 574.8 | 1012.1 | 13963.34 KB | 1.01 |
| ReadLine_ | Asset | 50000 | 125.231 ms | 3.16 | 29 | 232.3 | 2504.6 | 102135 KB | 7.40 |
| CsvHelper | Asset | 50000 | 127.145 ms | 3.20 | 29 | 228.8 | 2542.9 | 13971.75 KB | 1.01 |
| | | | | | | | | | |
| Sep______ | Asset | 1000000 | 850.145 ms | 1.00 | 581 | 684.4 | 850.1 | 266670.16 KB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 505.005 ms | 0.59 | 581 | 1152.2 | 505.0 | 276118.02 KB | 1.04 |
| Sylvan___ | Asset | 1000000 | 1,035.263 ms | 1.22 | 581 | 562.1 | 1035.3 | 266828.4 KB | 1.00 |
| ReadLine_ | Asset | 1000000 | 2,597.222 ms | 3.06 | 581 | 224.0 | 2597.2 | 2038837.9 KB | 7.65 |
| CsvHelper | Asset | 1000000 | 2,649.300 ms | 3.12 | 581 | 219.6 | 2649.3 | 266845.35 KB | 1.00 |
24 changes: 12 additions & 12 deletions benchmarks/AMD.EPYC.7763/PackageAssetsBenchQuotes-GcServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.100
[Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-OIQWSK : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
Job-CZUNEQ : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

Job=Job-OIQWSK EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Job=Job-CZUNEQ EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0 Runtime=.NET 9.0
Server=True Toolchain=net90 InvocationCount=Default
IterationTime=350ms MaxIterationCount=15 MinIterationCount=5
WarmupCount=6 Quotes=True Reader=String

```
| Method | Scope | Rows | Mean | Ratio | MB | MB/s | ns/row | Allocated | Alloc Ratio |
|---------- |------ |-------- |------------:|------:|----:|-------:|-------:|-----------:|------------:|
| Sep______ | Asset | 50000 | 40.58 ms | 1.00 | 33 | 820.3 | 811.5 | 13.48 MB | 1.00 |
| Sep_MT___ | Asset | 50000 | 22.12 ms | 0.55 | 33 | 1504.7 | 442.4 | 13.53 MB | 1.00 |
| Sylvan___ | Asset | 50000 | 65.08 ms | 1.60 | 33 | 511.4 | 1301.7 | 13.63 MB | 1.01 |
| ReadLine_ | Asset | 50000 | 67.34 ms | 1.66 | 33 | 494.3 | 1346.7 | 119.44 MB | 8.86 |
| CsvHelper | Asset | 50000 | 118.82 ms | 2.93 | 33 | 280.1 | 2376.4 | 13.64 MB | 1.01 |
| Sep______ | Asset | 50000 | 39.11 ms | 1.00 | 33 | 851.0 | 782.2 | 13.48 MB | 1.00 |
| Sep_MT___ | Asset | 50000 | 23.02 ms | 0.59 | 33 | 1445.6 | 460.5 | 13.53 MB | 1.00 |
| Sylvan___ | Asset | 50000 | 64.15 ms | 1.64 | 33 | 518.8 | 1283.0 | 13.63 MB | 1.01 |
| ReadLine_ | Asset | 50000 | 69.84 ms | 1.79 | 33 | 476.5 | 1396.8 | 119.44 MB | 8.86 |
| CsvHelper | Asset | 50000 | 119.33 ms | 3.05 | 33 | 278.9 | 2386.7 | 13.64 MB | 1.01 |
| | | | | | | | | | |
| Sep______ | Asset | 1000000 | 819.13 ms | 1.00 | 665 | 812.8 | 819.1 | 260.41 MB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 428.63 ms | 0.52 | 665 | 1553.3 | 428.6 | 263.24 MB | 1.01 |
| Sylvan___ | Asset | 1000000 | 1,324.33 ms | 1.62 | 665 | 502.7 | 1324.3 | 260.57 MB | 1.00 |
| ReadLine_ | Asset | 1000000 | 1,473.27 ms | 1.80 | 665 | 451.9 | 1473.3 | 2385.08 MB | 9.16 |
| CsvHelper | Asset | 1000000 | 2,389.26 ms | 2.92 | 665 | 278.7 | 2389.3 | 260.58 MB | 1.00 |
| Sep______ | Asset | 1000000 | 851.15 ms | 1.00 | 665 | 782.2 | 851.1 | 260.41 MB | 1.00 |
| Sep_MT___ | Asset | 1000000 | 433.22 ms | 0.51 | 665 | 1536.9 | 433.2 | 262.82 MB | 1.01 |
| Sylvan___ | Asset | 1000000 | 1,328.75 ms | 1.56 | 665 | 501.1 | 1328.7 | 260.57 MB | 1.00 |
| ReadLine_ | Asset | 1000000 | 1,477.57 ms | 1.74 | 665 | 450.6 | 1477.6 | 2385.07 MB | 9.16 |
| CsvHelper | Asset | 1000000 | 2,519.43 ms | 2.96 | 665 | 264.3 | 2519.4 | 260.59 MB | 1.00 |
Loading