Skip to content

Update dependencies and refactor Fixed Width Parser for performance - #46

Merged
GabrielMarquezMatte merged 20 commits into
masterfrom
develop
Jul 17, 2026
Merged

Update dependencies and refactor Fixed Width Parser for performance#46
GabrielMarquezMatte merged 20 commits into
masterfrom
develop

Conversation

@GabrielMarquezMatte

Copy link
Copy Markdown
Owner

This pull request makes several important improvements and updates across the codebase, focusing on code quality, dependency management, and public API consistency. The most significant changes include updating workflow configurations to support the develop branch, upgrading dependencies and analyzers, refactoring public API return types for consistency, and internal code cleanups.

Workflow and Dependency Updates:

  • Updated all GitHub Actions workflows to use actions/setup-dotnet@v6 and added support for the develop branch in CI and CodeQL triggers. [1] [2] [3] [4] [5] [6] [7] [8]
  • Upgraded analyzer and dependency versions in Directory.Build.props and FixedWidthParser.csproj (e.g., SonarAnalyzer.CSharp, Meziantou.Analyzer, Microsoft.CodeAnalysis.NetAnalyzers, csFastFloat, System.IO.Pipelines), and removed the unused Microsoft.CodeAnalysis.BannedApiAnalyzers package. [1] [2]

Public API Refactoring:

  • Changed the return types of all Read, ReadFile, and ReadAsync methods in FixedWidth.cs and FixedWidthUtf8.cs to use the generic FixedWidthRecordEnumerable<TModel, GeneratedLineParser<TModel>> and related types instead of the old GeneratedFixedWidthRecordEnumerable<TModel> types, improving API consistency and extensibility. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Internal Code Improvements:

  • Refactored DateTime type detection into a helper method IsDateTimeType in FixedWidthModelGenerator.cs for better code reuse and clarity. [1] [2] [3]
  • Changed the visibility of ColumnLayoutValidator from public to internal, restricting its usage to within the assembly.

Project File Cleanups:

  • Removed legacy or redundant MSBuild properties from Directory.Build.props to simplify the build configuration.

These changes collectively improve maintainability, code quality, and the developer experience.

dependabot Bot and others added 19 commits July 16, 2026 14:54
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 5 to 6.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: csFastFloat
  dependency-version: 4.1.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Microsoft.Testing.Extensions.CodeCoverage
  dependency-version: 18.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Microsoft.Testing.Extensions.TrxReport
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: Microsoft.Testing.Extensions.TrxReport
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: System.IO.Pipelines
  dependency-version: 10.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
- Updated the FixedWidthAsyncRecordEnumerable and FixedWidthRecordEnumerable classes to utilize a new generic RecordEnumeratorCore, allowing for better type handling and performance optimizations.
- Introduced ISource interface for managing buffered record reading, implemented by StreamSource and TextReaderSource.
- Refactored line parsing strategies to implement a new IRecordLineParser interface, enhancing type safety and reducing allocations.
- Removed obsolete Utf8AsyncRecordEnumeratorCore and Utf8RecordEnumeratorCore classes, consolidating functionality into the new generic structure.
- Updated tests to reflect changes in enumerator types, ensuring they remain value types for allocation-free iteration.
- Updated FixedWidthUtf8.cs to replace GeneratedUtf8FixedWidthRecordEnumerable with a more generic Utf8FixedWidthRecordEnumerable that accepts a line parser type.
- Refactored ColumnParserFactory and Utf8ColumnParserFactory to streamline date parsing logic using a new BuildExact method for better code reuse.
- Removed GeneratedFixedWidthAsyncRecordEnumerable and GeneratedFixedWidthRecordEnumerable classes to simplify the codebase and reduce redundancy.
- Updated various reader classes (FixedWidthAsyncRecordEnumerable, FixedWidthByteReader, FixedWidthReader, etc.) to utilize the new generic record enumerable structure.
- Enhanced Utf8FixedWidthAsyncRecordEnumerable and Utf8FixedWidthRecordEnumerable to accept a line parser type, improving flexibility and maintainability.
- Adjusted tests in GeneratedUtf8ReaderTests to reflect changes in the enumerable structure and ensure continued functionality.
Bumps Meziantou.Analyzer from 3.0.122 to 3.0.123
Bumps Microsoft.CodeAnalysis.NetAnalyzers from 11.0.100-preview.5.26302.115 to 11.0.100-preview.6.26359.118
Bumps SonarAnalyzer.CSharp from 10.28.0.143324 to 10.29.0.143774

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.123
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: analyzers
- dependency-name: Microsoft.CodeAnalysis.NetAnalyzers
  dependency-version: 11.0.100-preview.6.26359.118
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: analyzers
- dependency-name: SonarAnalyzer.CSharp
  dependency-version: 10.29.0.143774
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: analyzers
...

Signed-off-by: dependabot[bot] <support@github.com>
…FixedWidthParser/develop/System.IO.Pipelines-10.0.10

Bump System.IO.Pipelines from 10.0.9 to 10.0.10
…s/FixedWidthParser.Generator.Tests/develop/multi-747a3f1faf

Bump Microsoft.Testing.Extensions.TrxReport from 2.2.3 to 2.3.2
…FixedWidthParser/develop/csFastFloat-4.1.6

Bump csFastFloat from 4.1.5 to 4.1.6
…ests/develop/Microsoft.Testing.Extensions.CodeCoverage-18.9.0
…s/FixedWidthParser.Tests/develop/Microsoft.Testing.Extensions.CodeCoverage-18.9.0

Bump Microsoft.Testing.Extensions.CodeCoverage from 18.8.0 to 18.9.0
…lop/analyzers-88fc51832c

Bump Meziantou.Analyzer and 2 others
…ions/develop/actions/setup-dotnet-6

Bump actions/setup-dotnet from 5 to 6
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.53125% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.18%. Comparing base (d94aec9) to head (843a06f).

Files with missing lines Patch % Lines
...dWidthParser/Processors/Utf8ColumnParserFactory.cs 87.50% 0 Missing and 2 partials ⚠️
...c/FixedWidthParser/Readers/RecordEnumeratorCore.cs 81.81% 1 Missing and 1 partial ⚠️
...dWidthParser.Generator/FixedWidthModelGenerator.cs 83.33% 0 Missing and 1 partial ⚠️
...FixedWidthParser/Processors/ColumnParserFactory.cs 92.85% 0 Missing and 1 partial ⚠️
src/FixedWidthParser/Readers/TextReaderSource.cs 88.88% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   86.39%   89.18%   +2.79%     
==========================================
  Files          42       37       -5     
  Lines        1962     1738     -224     
  Branches      341      322      -19     
==========================================
- Hits         1695     1550     -145     
+ Misses        192      117      -75     
+ Partials       75       71       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Benchmark Results

Measured on ubuntu-latest (GitHub Actions). Runner noise may affect absolute numbers; use these for relative comparisons within a PR.

Benchmarks.Perf.AsyncReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
GeneratedReader_ReadAsync 100 4.925 μs 0.1120 μs 0.0291 μs 0.67 0.01 0.2518 4248 B 0.23
SpanReader_ReadAsync 100 6.951 μs 0.1010 μs 0.0156 μs 0.95 0.01 0.2518 4264 B 0.23
Naive_ReadLineAsync 100 7.350 μs 0.1711 μs 0.0444 μs 1.00 0.01 1.0986 18424 B 1.00
GeneratedReader_ReadAsync_Pooled 100 9.430 μs 0.1544 μs 0.0401 μs 1.28 0.01 0.0153 328 B 0.02
SpanReader_ReadAsync_Pooled 100 11.577 μs 0.0219 μs 0.0034 μs 1.58 0.01 0.0153 344 B 0.02
GeneratedReader_ReadAsync 1000 48.244 μs 0.7751 μs 0.1200 μs 0.64 0.01 2.3193 39528 B 0.216
SpanReader_ReadAsync 1000 68.839 μs 0.8810 μs 0.2288 μs 0.92 0.01 2.3193 39544 B 0.216
Naive_ReadLineAsync 1000 74.869 μs 3.8822 μs 1.0082 μs 1.00 0.02 10.8643 183304 B 1.000
GeneratedReader_ReadAsync_Pooled 1000 90.423 μs 0.5353 μs 0.1390 μs 1.21 0.01 - 328 B 0.002
SpanReader_ReadAsync_Pooled 1000 111.901 μs 0.2665 μs 0.0412 μs 1.49 0.02 - 344 B 0.002

Benchmarks.Perf.ByteReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
CharParser_Parse 100 5.358 μs 0.0565 μs 0.0087 μs 1.00 0.2289 3.83 KB 1.00
ByteParser_Parse 100 6.047 μs 0.0427 μs 0.0111 μs 1.13 0.2289 3.83 KB 1.00
CharParser_Parse_AfterUtf8Decode 100 7.283 μs 0.0544 μs 0.0084 μs 1.36 0.6638 10.86 KB 2.84
CharParser_Parse 1000 52.974 μs 0.4147 μs 0.1077 μs 1.00 2.3193 38.28 KB 1.00
ByteParser_Parse 1000 63.656 μs 0.2464 μs 0.0381 μs 1.20 2.3193 38.28 KB 1.00
CharParser_Parse_AfterUtf8Decode 1000 72.791 μs 0.4671 μs 0.0723 μs 1.37 6.5918 108.59 KB 2.84

Benchmarks.Perf.ByteReaderPoolingBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
NoString 100 4.476 μs 0.0154 μs 0.0024 μs 0.62 - - 0.00
WithString_NoPool 100 7.220 μs 0.0182 μs 0.0028 μs 1.00 0.2289 3920 B 1.00
WithString_Pooled 100 13.996 μs 0.0294 μs 0.0076 μs 1.94 - - 0.00
NoString 1000 44.823 μs 0.1209 μs 0.0187 μs 0.61 - - 0.00
WithString_NoPool 1000 73.245 μs 0.4679 μs 0.1215 μs 1.00 2.3193 39200 B 1.00
WithString_Pooled 1000 133.820 μs 0.3019 μs 0.0467 μs 1.83 - - 0.00

Benchmarks.Perf.ByteReaderStreamBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Gen1 Gen2 Allocated Alloc Ratio
ByteReader_Read 100 7.126 μs 0.0935 μs 0.0145 μs 0.28 0.2289 - - 3.83 KB 0.02
CharReader_Read 100 25.701 μs 0.7272 μs 0.1888 μs 1.00 41.6565 41.6565 41.6565 196.04 KB 1.00
ByteReader_Read 1000 74.371 μs 1.6889 μs 0.4386 μs 0.70 2.3193 - - 38.28 KB 0.17
CharReader_Read 1000 105.637 μs 2.0959 μs 0.5443 μs 1.00 41.6260 41.6260 41.6260 230.5 KB 1.00

Benchmarks.Perf.ComparisonBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Gen1 Allocated Alloc Ratio
FixedWidthParser_Generated 100 4.831 μs 0.0909 μs 0.0236 μs 0.14 0.2289 - 3.86 KB 0.09
FixedWidthParser_Read 100 6.369 μs 0.0381 μs 0.0059 μs 0.18 0.2289 - 3.86 KB 0.09
RecordParser_Read 100 10.813 μs 0.0959 μs 0.0249 μs 0.31 0.2441 - 4.23 KB 0.10
FileHelpers_Read 100 34.561 μs 0.4855 μs 0.1261 μs 1.00 2.5024 0.0610 41.49 KB 1.00
FlatFiles_Read 100 63.109 μs 1.0661 μs 0.1650 μs 1.83 6.2256 0.1221 103.13 KB 2.49
FixedWidthParser_Generated 1000 45.719 μs 0.8045 μs 0.1245 μs 0.13 2.3193 - 38.31 KB 0.09
FixedWidthParser_Read 1000 61.160 μs 1.4496 μs 0.2243 μs 0.18 2.3193 - 38.31 KB 0.09
RecordParser_Read 1000 107.627 μs 0.9099 μs 0.1408 μs 0.31 2.3193 - 38.69 KB 0.10
FileHelpers_Read 1000 344.075 μs 5.1429 μs 1.3356 μs 1.00 24.4141 5.8594 406.42 KB 1.00
FlatFiles_Read 1000 634.247 μs 9.5939 μs 2.4915 μs 1.84 57.6172 1.9531 953.2 KB 2.35

Benchmarks.Perf.ComparisonWriterBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
FixedWidthParser_Write 1 129.1 ns 0.24 ns 0.04 ns 0.72 0.00 - - - 0.00
FileHelpers_Write 1 178.2 ns 1.37 ns 0.21 ns 1.00 0.00 0.0215 - 360 B 1.00
FlatFiles_Write 1 428.5 ns 4.64 ns 1.20 ns 2.41 0.01 0.0424 - 712 B 1.98
RecordParser_Write 1 19,396.5 ns 754.90 ns 196.05 ns 108.86 1.02 1.0986 0.0305 18128 B 50.36
FixedWidthParser_Write 100 13,153.2 ns 28.01 ns 4.33 ns 0.74 0.00 - - - 0.00
FileHelpers_Write 100 17,676.5 ns 233.41 ns 60.62 ns 1.00 0.00 1.9531 - 32832 B 1.00
FlatFiles_Write 100 42,509.2 ns 579.79 ns 89.72 ns 2.40 0.01 4.2114 - 71200 B 2.17
RecordParser_Write 100 50,532.5 ns 5,856.37 ns 906.28 ns 2.86 0.05 1.2207 0.0610 20440 B 0.62
FixedWidthParser_Write 1000 132,088.4 ns 347.35 ns 53.75 ns 0.74 0.00 - - - 0.00
FileHelpers_Write 1000 178,468.8 ns 1,874.73 ns 290.12 ns 1.00 0.00 19.5313 - 328032 B 1.00
FlatFiles_Write 1000 420,658.2 ns 3,428.56 ns 530.57 ns 2.36 0.00 42.4805 - 712000 B 2.17
RecordParser_Write 1000 464,402.7 ns 156,741.98 ns 40,705.40 ns 2.60 0.21 82.0313 80.0781 1383639 B 4.22

Benchmarks.Perf.ParserBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Line Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
Parse_NoPool Jane (...)0.00 [25] 47.66 ns 2.800 ns 0.727 ns 1.00 0.02 0.0029 48 B 1.00
Parse_WithStringPool Jane (...)0.00 [25] 78.07 ns 0.374 ns 0.097 ns 1.64 0.02 - - 0.00
Parse_NoPool John (...)0.00 [25] 55.03 ns 0.319 ns 0.049 ns 1.00 0.00 0.0024 40 B 1.00
Parse_WithStringPool John (...)0.00 [25] 84.23 ns 0.211 ns 0.055 ns 1.53 0.00 - - 0.00

Benchmarks.Perf.PipeReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
Stream_ReadAsync 100 8.337 μs 0.0717 μs 0.0111 μs 1.00 0.2441 4.09 KB 1.00
Pipe_ReadAsync 100 16.837 μs 0.3075 μs 0.0476 μs 2.02 0.2441 4.48 KB 1.10
Pipe_ReadAsync_SmallSegments 100 55.647 μs 0.4663 μs 0.0722 μs 6.68 0.2441 4.67 KB 1.14
Stream_ReadAsync 1000 75.907 μs 0.1290 μs 0.0200 μs 1.00 2.3193 38.54 KB 1.00
Pipe_ReadAsync 1000 165.580 μs 1.1643 μs 0.1802 μs 2.18 2.1973 39.03 KB 1.01
Pipe_ReadAsync_SmallSegments 1000 537.333 μs 4.1154 μs 0.6369 μs 7.08 1.9531 39.13 KB 1.02

Benchmarks.Perf.ReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
GeneratedReader_Read 100 4.696 μs 0.0558 μs 0.0145 μs 0.71 0.2289 3952 B 0.354
SpanReader_Read 100 6.005 μs 0.0244 μs 0.0038 μs 0.90 0.2289 3952 B 0.354
Naive_ReadLine 100 6.656 μs 0.0857 μs 0.0222 μs 1.00 0.6638 11152 B 1.000
GeneratedReader_Read_Pooled 100 8.646 μs 0.1072 μs 0.0166 μs 1.30 - 32 B 0.003
SpanReader_Read_Pooled 100 10.157 μs 0.1613 μs 0.0419 μs 1.53 - 32 B 0.003
GeneratedReader_Read 1000 46.337 μs 0.2103 μs 0.0325 μs 0.69 2.3193 39232 B 0.353
SpanReader_Read 1000 60.997 μs 0.4468 μs 0.0691 μs 0.91 2.3193 39232 B 0.353
Naive_ReadLine 1000 66.860 μs 0.4151 μs 0.1078 μs 1.00 6.5918 111232 B 1.000
GeneratedReader_Read_Pooled 1000 85.553 μs 0.4290 μs 0.0664 μs 1.28 - 32 B 0.000
SpanReader_Read_Pooled 1000 103.260 μs 0.5893 μs 0.1530 μs 1.54 - 32 B 0.000

Benchmarks.Perf.ReaderStartupBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
GeneratedReader_ReadOne 113.0 ns 0.63 ns 0.10 ns 0.93 0.0043 72 B 0.75
ReflectionReader_ConstructAndReadOne 121.1 ns 2.24 ns 0.58 ns 1.00 0.0057 96 B 1.00

Benchmarks.Perf.SourceGenParserBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Line Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
Generated John (...)00.00 [25] 38.58 ns 0.599 ns 0.093 ns 0.69 0.0024 40 B 1.00
Reflection John (...)00.00 [25] 55.60 ns 0.639 ns 0.099 ns 1.00 0.0024 40 B 1.00

Benchmarks.Perf.WriterBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
  [Host]     : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4
  Job-MEHJPP : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Gen1 Allocated Alloc Ratio
WriteMany_ReuseWriterSpan 1 99.62 ns 0.905 ns 0.235 ns 0.55 - - - 0.00
WriteMany_ReuseWriter 1 101.90 ns 2.089 ns 0.543 ns 0.56 - - - 0.00
WriteMany_AsyncReuseWriter 1 130.61 ns 0.957 ns 0.148 ns 0.72 0.0019 - 32 B 0.01
WriteMany_NewStream 1 181.29 ns 5.084 ns 1.320 ns 1.00 0.1328 - 2224 B 1.00
WriteMany_AsyncNewStream 1 329.96 ns 1.406 ns 0.365 ns 1.82 0.3204 0.0029 5360 B 2.41
WriteMany_ReuseWriterSpan 100 10,186.65 ns 59.792 ns 9.253 ns 0.96 - - - 0.000
WriteMany_NewStream 100 10,625.77 ns 176.654 ns 27.337 ns 1.00 0.3052 - 5328 B 1.000
WriteMany_ReuseWriter 100 10,638.60 ns 82.984 ns 21.551 ns 1.00 - - - 0.000
WriteMany_AsyncReuseWriter 100 11,235.58 ns 79.567 ns 20.663 ns 1.06 - - 32 B 0.006
WriteMany_AsyncNewStream 100 11,695.29 ns 96.542 ns 14.940 ns 1.10 0.3204 - 5360 B 1.006
WriteMany_ReuseWriter 1000 102,750.03 ns 219.303 ns 56.952 ns 0.97 - - - 0.000
WriteMany_NewStream 1000 105,497.02 ns 918.750 ns 142.178 ns 1.00 0.2441 - 5328 B 1.000
WriteMany_ReuseWriterSpan 1000 105,517.37 ns 418.258 ns 108.620 ns 1.00 - - - 0.000
WriteMany_AsyncReuseWriter 1000 114,401.69 ns 627.542 ns 162.971 ns 1.08 - - 32 B 0.006
WriteMany_AsyncNewStream 1000 114,484.71 ns 980.802 ns 151.780 ns 1.09 0.2441 - 5360 B 1.006

@GabrielMarquezMatte
GabrielMarquezMatte merged commit a889d62 into master Jul 17, 2026
12 checks passed
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.

2 participants