Benchmarks
This page tracks the current manual benchmark snapshot for CodecMapper.
Read these numbers as workload-shaped comparisons, not universal claims. They are useful for seeing where CodecMapper is already competitive and where the runtime still needs work.
What this covers
The manual runner compares CodecMapper JSON encode and decode against:
System.Text.JsonNewtonsoft.Json
The current scenario matrix covers:
small-messageperson-batch-25person-batch-250escaped-articles-20telemetry-500person-batch-25-unknown-fields
These numbers were measured locally on March 16, 2026 with:
|
Snapshot
Scenario |
CodecMapper serialize |
STJ serialize |
Newtonsoft serialize |
CodecMapper deserialize |
STJ deserialize |
Newtonsoft deserialize |
Brief explanation |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Medium nested serialize remains close, but |
|
|
|
|
|
|
|
Larger nested batches are still competitive on serialize, but |
|
|
|
|
|
|
|
String-heavy payloads remain a clear weak spot, especially against |
|
|
|
|
|
|
|
Numeric-heavy payloads still need real optimization work, especially on decode. |
|
|
|
|
|
|
|
Unknown-field decode improved, but |
Current reading
CodecMapperis already competitive on small messages and stays reasonably close on medium nested-record serialize workloads.System.Text.Jsonstill leads on string-heavy and numeric-heavy workloads.Newtonsoft.Jsonis slower across the whole current matrix.- Decode on wider nested, numeric-heavy, and string-heavy payloads is still the most obvious performance gap.
How to use this
- Use the manual runner for quick relative checks while iterating.
- Use the BenchmarkDotNet app when you need richer statistical output.
- Use the
perfworkflow when one scenario clearly regresses or becomes the dominant hot path.
Commands:
|
For profiling guidance, see How To Profile Benchmark Hot Paths.
CodecMapper