PicoYaml 2026.1.8
dotnet add package PicoYaml --version 2026.1.8
NuGet\Install-Package PicoYaml -Version 2026.1.8
<PackageReference Include="PicoYaml" Version="2026.1.8" />
<PackageVersion Include="PicoYaml" Version="2026.1.8" />
<PackageReference Include="PicoYaml" />
paket add PicoYaml --version 2026.1.8
#r "nuget: PicoYaml, 2026.1.8"
#:package PicoYaml@2026.1.8
#addin nuget:?package=PicoYaml&version=2026.1.8
#tool nuget:?package=PicoYaml&version=2026.1.8
PicoSerDe
AOT-first, reflection-free serialization framework. Five formats, one
unified API. Source-generated ref struct readers/writers with zero heap
allocation on the hot path — deployable under NativeAOT and trimming where
many serialization libraries cannot run.
Modules
| Format | Package | Status | AOT | Readme |
|---|---|---|---|---|
| JSON | PicoJetson | ✅ Production | ✅ | → |
| MessagePack | PicoMsgPack | ✅ Production | ✅ | → |
| INI | PicoIni | 🟡 Beta | ✅ | → |
| TOML | PicoToml | 🟡 Beta | ✅ | → |
| YAML | PicoYaml | 🟡 Beta | ✅ | → |
PicoYaml is the only AOT-compatible YAML library on .NET.
Test Coverage
498+ tests across all 6 modules, with cross-validation against 5 competitor libraries:
| Module | Tests | Competitor | Cross-Validation |
|---|---|---|---|
| PicoJetson | 145 | System.Text.Json | ✅ bidirectional, all 19 property types |
| PicoToml | 80 | Tomlyn | ✅ bidirectional, 20 property types, NestedList via [[key]] |
| PicoYaml | 81 | YamlDotNet | ✅ bidirectional, 19 property types, DateOnly/TimeOnly conerters |
| PicoIni | 87 | Microsoft.Extensions.Configuration.Ini | ✅ bidirectional, 16 property types |
| PicoMsgPack | 77 | MessagePack-CSharp | ✅ map/array dual-format, 14 property types |
| PicoSerDe.Core | 35 | — | — |
Performance Summary
Numbers below are PicoSerDe on NativeAOT vs competitors on JIT — the competitors cannot run under NativeAOT at all. In a JIT environment, mature reflection-based parsers may still be faster; PicoSerDe's advantage is guaranteed deployability under trimming and self-contained publishing, not peak JIT throughput.
Benchmarks: AOT self-contained, .NET 10, 100K iterations, win-x64.
| Module | vs Competitor | Avg Speedup | Competitor AOT? |
|---|---|---|---|
| PicoJetson | System.Text.Json | 1.35x | ✅ |
| PicoMsgPack | MessagePack-CSharp | 1.40x | ❌ |
| PicoIni | ini-parser | 0.12x | ❌ |
| PicoToml | Tommy | 0.30x | ❌ |
| PicoYaml | — | — | ❌ |
JSON/MessagePack are faster than or competitive with JIT-based alternatives even in AOT mode. INI/TOML/YAML prioritize correct, reflection-free parsing over peak throughput — their JIT competitors benefit from years of runtime-level optimizations (cached keys, direct span writes, dynamic code gen) that are incompatible with NativeAOT. PicoSerDe is the only option that runs at all in a fully-trimmed, self-contained NativeAOT deployment for these formats.
Design
// One API across all formats
JsonSerializer.Serialize<T>(value) // → byte[] via PicoJetson
MsgPackSerializer.Deserialize<T>(data) // T ← byte[] via PicoMsgPack
IniSerializer.Serialize(config) // → string via PicoIni
┌──────────────────────────────────────────────┐
│ User Code │
└──────────────────┬───────────────────────────┘
│ Static Cache<T>
┌──────────────────▼───────────────────────────┐
│ PicoSerDe.Core │
│ ISerializer<T> │ IDeserializer<T> │
│ TokenType │ SimdHelpers (Vector128) │
│ TextHelpers │ SerializerExtensions │
└────┬────────┬─────────┬─────────┬─────────┬──┘
│ │ │ │ │
PicoJetson PicoIni PicoMsgPack PicoToml PicoYaml
││ ││ ││ ││ ││
.Gen .Gen .Gen .Gen .Gen
- Dual-package: each format → runtime library (net10.0) + source generator (netstandard2.0)
ref structreaders/writers — stack-allocated, zero heap allocation on hot path- Static
Cache<T>— JIT/AOT inlineable, no dictionary lookups file structgenerated implementations — devirtualization without sealed class overheadJsonOptions— runtime configuration (indentation, naming policy, ignore conditions, etc.) flowing through ThreadStatic to SG-generated code
PicoJetson JsonOptions
// Compact (default) — optimal for data transfer
byte[] data = JsonSerializer.SerializeToUtf8Bytes(model);
// Human-readable
byte[] data = JsonSerializer.SerializeToUtf8Bytes(model,
new JsonOptions { Indented = true });
// CamelCase naming
byte[] data = JsonSerializer.SerializeToUtf8Bytes(model,
new JsonOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
// Skip null properties
byte[] data = JsonSerializer.SerializeToUtf8Bytes(model,
new JsonOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull });
// Allow NaN/Infinity
byte[] data = JsonSerializer.SerializeToUtf8Bytes(model,
new JsonOptions { NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals });
Available options:
| Option | Default | Description |
|---|---|---|
Indented |
false |
Human-readable indented output |
MaxDepth |
63 |
Maximum nesting depth |
PropertyNamingPolicy |
null |
Naming policy: CamelCase, SnakeCaseLower, KebabCaseLower, PascalCase |
DefaultIgnoreCondition |
Never |
Skip null/default properties: WhenWritingNull, WhenWritingDefault |
NumberHandling |
Strict |
Allow named floats: AllowNamedFloatingPointLiterals |
PropertyNameCaseInsensitive |
false |
Case-insensitive property matching (default is already case-insensitive) |
AllowTrailingCommas |
false |
Accept trailing commas in objects/arrays |
ReadCommentHandling |
Disallow |
Skip // and /* */ comments |
UnmappedMemberHandling |
Skip |
Throw on unknown properties: Disallow |
Packages
| Package | NuGet |
|---|---|
PicoSerDe.Core |
|
PicoJetson / .Gen |
|
PicoMsgPack / .Gen |
|
PicoIni / .Gen |
|
PicoToml / .Gen |
|
PicoYaml / .Gen |
CI/CD
| Target | Runner |
|---|---|
| win-x64 | windows-latest |
| win-arm64 | windows-latest |
| linux-x64 | ubuntu-latest |
| linux-arm64 | ubuntu-24.04-arm |
| osx-arm64 | macos-latest |
Every push: build + test (498+ tests) + 5 benchmarks smoke + 5 AOT sample publishes.
Release: v* tag → packs 11 packages in dependency order → NuGet.org.
Comparison
| PicoSerDe | S.T.Json | YamlDotNet | VYaml | MsgPack-CS | Tommy | |
|---|---|---|---|---|---|---|
| Formats | 5 | 1 | 1 | 1 | 1 | 1 |
| AOT | ✅ | ✅ | ❌ | ⚠️ | ❌ | ❌ |
| Zero-reflection | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Zero annotations | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
| ref struct | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| SIMD | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- PicoSerDe.Core (>= 2026.1.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.