Skip to content

Add asynchronous Stream serializer APIs - #203

Merged
dameng324 merged 3 commits into
mainfrom
codex/async-stream-serializer-reapplied
Jul 12, 2026
Merged

Add asynchronous Stream serializer APIs#203
dameng324 merged 3 commits into
mainfrom
codex/async-stream-serializer-reapplied

Conversation

@dameng324

Copy link
Copy Markdown
Owner

Summary

  • add pooled-buffer asynchronous Stream serialization and deserialization APIs
  • add asynchronous length-prefixed framing APIs, including DeserializeItemsAsync
  • document synchronous codec versus asynchronous I/O semantics and PipeReader/PipeWriter guidance
  • cover async-only streams, framing, malformed input, field skipping, and static-abstract overloads

Validation

  • dotnet build src\\LightProto\\LightProto.csproj -c Release --no-restore
  • dotnet test tests\\LightProto.Tests\\LightProto.Tests.csproj -c Release -p:PublishAot=false --no-restore --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --timeout 60s --minimum-expected-tests 1
  • 49,481 tests passed; local net10.0 line coverage: 95.26%

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 103 complexity · 8 duplication

Metric Results
Complexity 103
Duplication 8

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.26199% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.52%. Comparing base (0cbf8e2) to head (a9be068).

Files with missing lines Patch % Lines
src/LightProto/Serializer.LengthPrefix.cs 98.46% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   95.19%   95.52%   +0.32%     
==========================================
  Files         125      127       +2     
  Lines        3394     3665     +271     
  Branches      464      518      +54     
==========================================
+ Hits         3231     3501     +270     
  Misses         90       90              
- Partials       73       74       +1     

☔ 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

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.58GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]    : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 10.0 : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  .NET 8.0  : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 9.0  : .NET 9.0.17 (9.0.17, 9.0.1726.26416), X64 RyuJIT x86-64-v3


Method Job Runtime Mean Error StdDev Ratio Allocated Alloc Ratio
Deserialize_ProtoBuf_net .NET 10.0 .NET 10.0 778.9 μs 2.45 μs 2.17 μs 1.23 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 10.0 .NET 10.0 656.7 μs 2.88 μs 2.56 μs 1.03 648.7 KB 1.13
Deserialize_LightProto .NET 10.0 .NET 10.0 634.6 μs 0.96 μs 0.75 μs 1.00 574.8 KB 1.00
Deserialize_ProtoBuf_net .NET 8.0 .NET 8.0 908.3 μs 1.45 μs 1.29 μs 1.37 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 8.0 .NET 8.0 853.1 μs 1.37 μs 1.22 μs 1.28 648.7 KB 1.13
Deserialize_LightProto .NET 8.0 .NET 8.0 664.5 μs 0.97 μs 0.76 μs 1.00 574.8 KB 1.00
Deserialize_ProtoBuf_net .NET 9.0 .NET 9.0 859.0 μs 2.81 μs 2.49 μs 1.33 562 KB 0.98
Deserialize_GoogleProtoBuf .NET 9.0 .NET 9.0 704.5 μs 5.01 μs 4.44 μs 1.09 648.7 KB 1.13
Deserialize_LightProto .NET 9.0 .NET 9.0 648.2 μs 1.85 μs 1.73 μs 1.00 574.8 KB 1.00

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.58GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.301
  [Host]    : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 10.0 : .NET 10.0.9 (10.0.9, 10.0.926.27113), X64 RyuJIT x86-64-v3
  .NET 8.0  : .NET 8.0.28 (8.0.28, 8.0.2826.26413), X64 RyuJIT x86-64-v3
  .NET 9.0  : .NET 9.0.17 (9.0.17, 9.0.1726.26416), X64 RyuJIT x86-64-v3


Method Job Runtime Mean Error StdDev Ratio RatioSD Allocated Alloc Ratio
Serialize_ProtoBuf_net .NET 10.0 .NET 10.0 964.3 μs 5.60 μs 4.68 μs 1.31 0.01 526.41 KB 1.03
Serialize_GoogleProtoBuf .NET 10.0 .NET 10.0 834.6 μs 7.30 μs 6.47 μs 1.13 0.01 512.95 KB 1.00
Serialize_LightProto .NET 10.0 .NET 10.0 737.5 μs 6.08 μs 5.69 μs 1.00 0.01 512.92 KB 1.00
Serialize_ProtoBuf_net .NET 8.0 .NET 8.0 1,077.2 μs 7.94 μs 7.04 μs 1.35 0.01 526.4 KB 1.03
Serialize_GoogleProtoBuf .NET 8.0 .NET 8.0 853.6 μs 4.69 μs 3.91 μs 1.07 0.01 512.95 KB 1.00
Serialize_LightProto .NET 8.0 .NET 8.0 797.2 μs 7.88 μs 7.37 μs 1.00 0.01 512.92 KB 1.00
Serialize_ProtoBuf_net .NET 9.0 .NET 9.0 1,027.3 μs 12.78 μs 11.96 μs 1.30 0.02 526.4 KB 1.03
Serialize_GoogleProtoBuf .NET 9.0 .NET 9.0 864.0 μs 11.29 μs 10.56 μs 1.09 0.01 512.95 KB 1.00
Serialize_LightProto .NET 9.0 .NET 9.0 790.3 μs 6.23 μs 5.53 μs 1.00 0.01 512.92 KB 1.00

@dameng324
dameng324 merged commit 3fd2256 into main Jul 12, 2026
8 checks passed
@dameng324
dameng324 deleted the codex/async-stream-serializer-reapplied branch July 12, 2026 02:31
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.

Async variants of Stream-based Serialization & Deserialization functions

1 participant