How .NET 10.0 boosted JSON Schema performance by 18%

At endjin, we maintain Corvus.JsonSchema, an open source high-performance library for serialization and validation of JSON using JSON Schema.
Its first release was on .NET 7.0, and its performance was pretty impressive. Ian Griffiths has given a number of talks on the techniques it uses to achieve its performance goals.
Since then, the .NET 8.0 runtime shipped, and with no code changes at all, we got a "free" performance boost of ~20%.
And then, when .NET 9.0 shipped, we got a further 32% performance boost, with our new Corvus.JsonSchema V4 codebase.
Now, with the .NET 10.0 release candidate available, we can see another significant boost: ~18% "for free" just for switching out the runtime.
If you have a LTS-based upgrade cycle and you are switching from .NET 8 to .NET 10, you'll see a pretty amazing 29% improvement.
Here are the details.
The Benchmark
We run the benchmark on a 13th Gen Intel Core i7-13800H 2.90GHz, 1 CPU, 20 logical and 14 physical cores.
The dotnet versions are as follows: .NET 10.0.0 (10.0.0-rc.1.25451.107, 10.0.25.45207), X64 RyuJIT x86-64-v3 .NET 8.0.20 (8.0.20, 8.0.2025.41914), X64 RyuJIT x86-64-v3 .NET 9.0.9 (9.0.9, 9.0.925.41916), X64 RyuJIT x86-64-v3
Validating a large array consisting of 10,000 small JSON documents. This is typical of a small JSON payload in a web API. It includes some strings, some formatted strings (e.g. email, date), and some numeric values.
{
"name": {
"familyName": "Oldroyd",
"givenName": "Michael",
"otherNames": [],
"email": "michael.oldryoyd@contoso.com"
},
"dateOfBirth": "1944-07-14",
"netWorth": 1234567890.1234567891,
"height": 1.8
}
Method | Runtime | Mean | Ratio | Allocated |
---|---|---|---|---|
ValidateLargeArrayCorvusV4 | .NET 8.0 | 9.804 ms | 1.00 | - |
ValidateLargeArrayCorvusV4 | .NET 9.0 | 8.447 ms | 0.86 | - |
ValidateLargeArrayCorvusV4 | .NET 10.0 | 6.913 ms | 0.71 | - |
Notes on 7.0
.NET 7.0 is no longer supported, and we have dropped it from the benchmarks.
Is this the end of the free lunch?
As always, we question whether we would be seeing the end of the free lunch. Last year, we figured that we would still get improvements from .NET 10 and we were right. I don't think we've reached the end of the road yet.
Looking at the future
We are currently working on vNext of Corvus.JsonSchema. It has some significant changes in the code generator, and produces code which offers 2-10x improvement in validation efficiency. This is likely to land in the .NET 10 timeframe - and will no doubt take advantage of optimizations available in .NET 11!