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 11, 2026 with:
|
Snapshot
Scenario |
CodecMapper serialize |
STJ serialize |
Newtonsoft serialize |
CodecMapper deserialize |
STJ deserialize |
Newtonsoft deserialize |
Brief explanation |
|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Medium nested decode is effectively even; serialize remains close. |
|
|
|
|
|
|
|
Larger nested batches are still competitive, but |
|
|
|
|
|
|
|
String-heavy payloads are a clear weak spot today. |
|
|
|
|
|
|
|
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 medium nested-record contracts.System.Text.Jsonstill leads on string-heavy and numeric-heavy workloads.Newtonsoft.Jsonis slower across the whole current matrix.- Decode on wider numeric 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