Skip to content

Bump Meziantou.Analyzer to version 3.0.105 and refactor parsing methods#27

Merged
GabrielMarquezMatte merged 3 commits into
masterfrom
develop
Jun 19, 2026
Merged

Bump Meziantou.Analyzer to version 3.0.105 and refactor parsing methods#27
GabrielMarquezMatte merged 3 commits into
masterfrom
develop

Conversation

@GabrielMarquezMatte

Copy link
Copy Markdown
Owner

This pull request refactors how fallback parsers are created in both the ColumnParserFactory and Utf8ColumnParserFactory by replacing the allocation of delegate-based value parsers with direct calls to static-abstract TryParse methods. This change reduces indirection and improves performance by allowing the JIT to inline these calls and avoid unnecessary delegate allocations. The shared factory logic is updated accordingly, and some minor cleanup is performed.

Parser construction and performance improvements:

  • Replaced the creation of delegate-based fallback value parsers with new BuildParsable methods in both ColumnParserFactory and Utf8ColumnParserFactory. These methods generate column parsers that call the static-abstract TryParse directly, reducing one level of indirection and avoiding delegate allocation. [1] [2] [3] [4]
  • Updated the shared ColumnParserFactoryShared.Create method to use the new BuildParsable approach for fallback parsing, only using the registry and generic builder for registered (custom) parsers. [1] [2]

Dependency and cleanup:

  • Bumped Meziantou.Analyzer NuGet package version from 3.0.104 to 3.0.105.
  • Removed unused System.Diagnostics.CodeAnalysis using directives from parser factory files. [1] [2]

dependabot Bot and others added 3 commits June 19, 2026 18:11
Bumps Meziantou.Analyzer from 3.0.104 to 3.0.105

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.105
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: analyzers
...

Signed-off-by: dependabot[bot] <support@github.com>
…lop/analyzers-d09dba7c20

Bump the analyzers group with 1 update
@codecov-commenter

Copy link
Copy Markdown

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (9ab60f3) to head (41f5390).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
+ Coverage   97.39%   97.43%   +0.03%     
==========================================
  Files          43       43              
  Lines        1307     1323      +16     
  Branches      199      199              
==========================================
+ Hits         1273     1289      +16     
  Misses          9        9              
  Partials       25       25              

☔ 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

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.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
GeneratedReader_ReadAsync 100 5.599 μs 0.0485 μs 0.0075 μs 0.75 0.01 0.2518 4216 B 0.23
Naive_ReadLineAsync 100 7.436 μs 0.4417 μs 0.0684 μs 1.00 0.01 1.0986 18424 B 1.00
SpanReader_ReadAsync 100 7.671 μs 0.1315 μs 0.0203 μs 1.03 0.01 0.2441 4232 B 0.23
GeneratedReader_ReadAsync_Pooled 100 9.895 μs 0.1114 μs 0.0172 μs 1.33 0.01 0.0153 296 B 0.02
SpanReader_ReadAsync_Pooled 100 12.461 μs 0.5108 μs 0.1326 μs 1.68 0.02 0.0153 312 B 0.02
GeneratedReader_ReadAsync 1000 55.210 μs 0.7774 μs 0.1203 μs 0.73 0.00 2.3193 39496 B 0.215
Naive_ReadLineAsync 1000 75.565 μs 1.9340 μs 0.5022 μs 1.00 0.01 10.8643 183304 B 1.000
SpanReader_ReadAsync 1000 77.347 μs 0.6452 μs 0.1676 μs 1.02 0.01 2.3193 39512 B 0.216
GeneratedReader_ReadAsync_Pooled 1000 93.847 μs 0.9427 μs 0.2448 μs 1.24 0.01 - 296 B 0.002
SpanReader_ReadAsync_Pooled 1000 121.343 μs 0.9118 μs 0.2368 μs 1.61 0.01 - 312 B 0.002

Benchmarks.Perf.ByteReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.85GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
CharParser_Parse 100 4.736 μs 0.0941 μs 0.0146 μs 1.00 0.00 0.2289 3.83 KB 1.00
ByteParser_Parse 100 5.151 μs 0.0671 μs 0.0174 μs 1.09 0.00 0.2289 3.83 KB 1.00
CharParser_Parse_AfterUtf8Decode 100 6.798 μs 0.0979 μs 0.0152 μs 1.44 0.00 0.6638 10.86 KB 2.84
CharParser_Parse 1000 49.171 μs 2.0543 μs 0.5335 μs 1.00 0.01 2.3193 38.28 KB 1.00
ByteParser_Parse 1000 60.141 μs 0.6275 μs 0.0971 μs 1.22 0.01 2.3193 38.28 KB 1.00
CharParser_Parse_AfterUtf8Decode 1000 92.787 μs 1.7453 μs 0.2701 μs 1.89 0.02 6.5918 108.59 KB 2.84

Benchmarks.Perf.ByteReaderPoolingBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.85GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
NoString 100 3.489 μs 0.0500 μs 0.0130 μs 0.54 - - 0.00
WithString_NoPool 100 6.467 μs 0.0700 μs 0.0182 μs 1.00 0.2289 3920 B 1.00
WithString_Pooled 100 13.850 μs 0.0826 μs 0.0214 μs 2.14 - - 0.00
NoString 1000 33.281 μs 0.1034 μs 0.0160 μs 0.57 - - 0.00
WithString_NoPool 1000 58.902 μs 0.5405 μs 0.0836 μs 1.00 2.3193 39200 B 1.00
WithString_Pooled 1000 139.080 μs 1.1654 μs 0.1803 μs 2.36 - - 0.00

Benchmarks.Perf.ByteReaderStreamBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.85GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Gen1 Allocated Alloc Ratio
ByteReader_Read 100 5.879 μs 0.1222 μs 0.0317 μs 0.92 0.2289 - 3.83 KB 0.24
CharReader_Read 100 6.369 μs 0.1312 μs 0.0203 μs 1.00 0.9766 0.0458 16.03 KB 1.00
CharReader_Read 1000 60.855 μs 0.5547 μs 0.1440 μs 1.00 3.0518 0.1221 50.48 KB 1.00
ByteReader_Read 1000 61.274 μs 0.2771 μs 0.0429 μs 1.01 2.3193 - 38.28 KB 0.76

Benchmarks.Perf.ParserBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v4
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v4

IterationCount=5  WarmupCount=1  

Method Line Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
Parse_NoPool Jane (...)0.00 [25] 47.65 ns 3.011 ns 0.782 ns 1.00 0.02 0.0019 48 B 1.00
Parse_WithStringPool Jane (...)0.00 [25] 75.14 ns 1.145 ns 0.297 ns 1.58 0.02 - - 0.00
Parse_NoPool John (...)0.00 [25] 46.79 ns 0.660 ns 0.102 ns 1.00 0.00 0.0015 40 B 1.00
Parse_WithStringPool John (...)0.00 [25] 71.46 ns 0.221 ns 0.034 ns 1.53 0.00 - - 0.00

Benchmarks.Perf.PipeReaderBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.85GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
Stream_ReadAsync 100 8.251 μs 0.1733 μs 0.0450 μs 1.00 0.01 0.2441 4.08 KB 1.00
Pipe_ReadAsync 100 18.547 μs 0.1655 μs 0.0256 μs 2.25 0.01 0.2441 4.41 KB 1.08
Pipe_ReadAsync_SmallSegments 100 59.696 μs 1.0734 μs 0.2788 μs 7.24 0.05 0.2441 4.6 KB 1.13
Stream_ReadAsync 1000 79.706 μs 0.2700 μs 0.0418 μs 1.00 0.00 2.3193 38.53 KB 1.00
Pipe_ReadAsync 1000 207.447 μs 1.2322 μs 0.1907 μs 2.60 0.00 2.1973 38.96 KB 1.01
Pipe_ReadAsync_SmallSegments 1000 620.726 μs 6.7136 μs 1.7435 μs 7.79 0.02 1.9531 39.05 KB 1.01

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.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
GeneratedReader_Read 100 4.339 μs 0.0519 μs 0.0080 μs 0.66 0.2289 3952 B 0.354
SpanReader_Read 100 6.150 μs 0.0451 μs 0.0117 μs 0.93 0.2289 3952 B 0.354
Naive_ReadLine 100 6.603 μs 0.0882 μs 0.0229 μs 1.00 0.6638 11152 B 1.000
GeneratedReader_Read_Pooled 100 8.371 μs 0.0930 μs 0.0241 μs 1.27 - 32 B 0.003
SpanReader_Read_Pooled 100 10.010 μs 0.1645 μs 0.0427 μs 1.52 - 32 B 0.003
GeneratedReader_Read 1000 43.631 μs 0.5874 μs 0.0909 μs 0.64 2.3193 39232 B 0.353
SpanReader_Read 1000 59.288 μs 0.4942 μs 0.1283 μs 0.87 2.3193 39232 B 0.353
Naive_ReadLine 1000 67.801 μs 0.9088 μs 0.2360 μs 1.00 6.5918 111232 B 1.000
GeneratedReader_Read_Pooled 1000 83.979 μs 0.4413 μs 0.0683 μs 1.24 - 32 B 0.000
SpanReader_Read_Pooled 1000 99.890 μs 3.1898 μs 0.8284 μs 1.47 - 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.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
GeneratedReader_ReadOne 92.40 ns 1.476 ns 0.383 ns 0.82 0.02 0.0043 72 B 0.75
ReflectionReader_ConstructAndReadOne 112.92 ns 9.389 ns 2.438 ns 1.00 0.03 0.0057 96 B 1.00

Benchmarks.Perf.SourceGenParserBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v4
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v4

IterationCount=5  WarmupCount=1  

Method Line Mean Error StdDev Ratio Gen0 Allocated Alloc Ratio
Reflection John (...)00.00 [25] 45.79 ns 1.696 ns 0.440 ns 1.00 0.0015 40 B 1.00
Generated John (...)00.00 [25] 48.44 ns 0.315 ns 0.049 ns 1.06 0.0015 40 B 1.00

Benchmarks.Perf.WriterBenchmarks


BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]     : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  Job-MEHJPP : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3

IterationCount=5  WarmupCount=1  

Method Count Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
WriteMany_ReuseWriter 1 116.6 ns 0.58 ns 0.09 ns 0.43 0.01 - - - 0.00
WriteMany_ReuseWriterSpan 1 118.9 ns 0.66 ns 0.10 ns 0.44 0.02 - - - 0.00
WriteMany_AsyncReuseWriter 1 200.4 ns 1.87 ns 0.49 ns 0.74 0.03 0.0019 - 32 B 0.01
WriteMany_NewStream 1 270.1 ns 38.65 ns 10.04 ns 1.00 0.05 0.1326 - 2224 B 1.00
WriteMany_AsyncNewStream 1 534.6 ns 90.69 ns 23.55 ns 1.98 0.10 0.3204 0.0029 5360 B 2.41
WriteMany_ReuseWriterSpan 100 12,452.5 ns 19.31 ns 5.01 ns 0.94 0.00 - - - 0.000
WriteMany_ReuseWriter 100 12,881.1 ns 1,166.83 ns 303.02 ns 0.98 0.02 - - - 0.000
WriteMany_NewStream 100 13,191.6 ns 318.52 ns 49.29 ns 1.00 0.00 0.3052 - 5328 B 1.000
WriteMany_AsyncReuseWriter 100 13,792.6 ns 144.99 ns 37.65 ns 1.05 0.00 - - 32 B 0.006
WriteMany_AsyncNewStream 100 16,119.6 ns 154.29 ns 40.07 ns 1.22 0.00 0.3052 - 5360 B 1.006
WriteMany_ReuseWriter 1000 123,415.6 ns 578.69 ns 89.55 ns 0.98 0.00 - - - 0.000
WriteMany_ReuseWriterSpan 1000 123,907.8 ns 278.50 ns 43.10 ns 0.98 0.00 - - - 0.000
WriteMany_NewStream 1000 126,140.1 ns 856.89 ns 222.53 ns 1.00 0.00 0.2441 - 5328 B 1.000
WriteMany_AsyncNewStream 1000 141,866.3 ns 1,971.26 ns 511.93 ns 1.12 0.00 0.2441 - 5360 B 1.006
WriteMany_AsyncReuseWriter 1000 144,062.8 ns 1,168.94 ns 303.57 ns 1.14 0.00 - - 32 B 0.006

@GabrielMarquezMatte GabrielMarquezMatte merged commit 334627a into master Jun 19, 2026
11 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.

3 participants