How .NET 11.0 boosted AIS.NET performance by 2%
TLDR; .NET 11.0 increased performance in our Ais.NET library by 2% with no code changes. For non-trivial processing, performance is well over twice as fast as it was on .NET Core 3.1. A modern desktop computer can process 12.2 million messages per second on a single thread!
At endjin, we maintain Ais.Net, an open source high-performance library for parsing AIS messages (the radio messages that ships broadcast to report their location, speed, etc.). Each time a new version of .NET ships, we check it all still works and then run our benchmarks again. Each year, we've seen significant improvements:
So what about .NET 11.0? The short answer is that yet again it is faster, although by a smaller margin than in previous years. However, to be able to continue to make meaningful comparisons, we need to rebaseline the existing results.
Benchmark results
Old versions, new hardware
I have retired the desktop I had been using when I first started benchmarking this library. So to be able to provide a meaningful comparison, I've had to rerun the benchmarks on all the older runtimes, to make these figures directly comparable. Here are all the results for every version of .NET previously tested on, but running on my new desktop, which has an AMD Ryzen 9 9900X3D processor.
.NET Core 2.1
I was no longer able to get the benchmark to build and run on a runtime this old. It has been out of support for over 5 years.
.NET Core 3.1
| Method | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 155.4 ms | 1.29 ms | 1.08 ms | 25 KB |
| ReadPositionsFromNorwayFile1M | 207.1 ms | 1.83 ms | 1.71 ms | 25 KB |
This corresponds to a maximum message processing rate of 6.4M message per second, or 4.8M/s when reading some basic information from the message. (On my old desktop, we got 3.0M/s and 2.6M/s respectively.)
.NET 6.0
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 133.4 ms | 0.68 ms | 0.53 ms | 4 KB | 16% |
| ReadPositionsFromNorwayFile1M | 167.8 ms | 1.03 ms | 0.86 ms | 5 KB | 23% |
This corresponds to a maximum message processing rate of 7.5M message per second, or 6.0M/s when reading some basic information from the message. (On my old desktop, we got 3.8M/s and 3.1M/s respectively.)
.NET 7.0
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 116.8 ms | 1.14 ms | 0.95 ms | - | 14% |
| ReadPositionsFromNorwayFile1M | 154.7 ms | 1.31 ms | 1.22 ms | - | 8% |
This corresponds to a maximum message processing rate of 8.6M message per second, or 6.5M/s when reading some basic information from the message. (On my old desktop, we got 4.7M/s and 3.7M/s respectively.)
.NET 8.0
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 100.2 ms | 1.11 ms | 1.04 ms | - | 17% |
| ReadPositionsFromNorwayFile1M | 114.0 ms | 1.06 ms | 0.94 ms | - | 36% |
This corresponds to a maximum message processing rate of 10.0M message per second, or 8.8M/s when reading some basic information from the message. (On my old desktop, we got 5.7M/s and 4.8M/s respectively.)
.NET 9.0
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 87.71 ms | 0.490 ms | 0.410 ms | 4 KB | 14% |
| ReadPositionsFromNorwayFile1M | 101.65 ms | 0.625 ms | 0.585 ms | 4 KB | 12% |
This corresponds to a maximum message processing rate of 11.4M message per second, or 9.8M/s when reading some basic information from the message. (On my old desktop, we got 6.4M/s and 5.2M/s respectively.)
.NET 10.0
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 83.22 ms | 0.491 ms | 0.436 ms | 4 KB | 5% |
| ReadPositionsFromNorwayFile1M | 96.99 ms | 0.710 ms | 0.555 ms | 4 KB | 5% |
This corresponds to a maximum message processing rate of 12.0M message per second, or 10.3M/s when reading some basic information from the message. (On my old desktop, we got 6.8M/s and 5.6M/s respectively.)
And now: .NET 11.0
It's worth noting that the version-on-version improvements I see on my new desktop don't always match what I observed running the same benchmarks on my older machine. For the simple message-type inspection benchmark, the gains are mostly smaller on the new desktop, with the exception of .NET 9.0, which saw a larger increase. But for the more realistic position-reading benchmark, the picture is mixed: .NET 6.0 (23% versus the 20% reported back then), .NET 8.0 (36% versus 27%) and .NET 9.0 (12% versus 9%) all improved by more on the new desktop, while .NET 7.0 (8% versus 19%) and .NET 10.0 (5% versus 7%) improved by less. But now, what about .NET 11?
| Method | Mean | Error | StdDev | Allocated | Improvement |
|---|---|---|---|---|---|
| InspectMessageTypesFromNorwayFile1M | 81.85 ms | 0.414 ms | 0.367 ms | 4,605 B | 1-2% |
| ReadPositionsFromNorwayFile1M | 94.42 ms | 0.947 ms | 0.886 ms | - | 2-4% |
This corresponds to a maximum message processing rate of 12.2M message per second, or 10.6M/s when reading some basic information from the message.
For the sixth year running, we're enjoying a free lunch, although by a much smaller margin this year. In fact, the gain is small enough that the margins of error mean that we can't report the exact improvement all that precisely. There's definitely an improvement, but it might be as low as 1% on the more pessimistic measure.
Even so, without making any changes whatsoever to our code, we still see a measurable improvement simply by running the code on .NET 11.0 instead of .NET 10.0. As with last time, we've not had to release a new library version—the existing version published on NuGet (which targets netstandard2.0 and netstandard2.1) runs faster just as a result of upgrading your application to .NET 11.0.
Our memory usage is roughly the same. You will probably have noticed the reported allocation varying between nothing and about 4K (with .NET Core 3.1 being an outlier at 25KB) but this actually varies from test to test even within a single runtime. As far as I can tell it's random as to whether the benchmark actually sees this initialization cost. What matters though is that our amortized allocation cost per record continues to be 0 bytes. The total memory usage including startup costs is very similar: a handful of kilobytes, depending on exactly which features you use.
Free performance gains over time
The bottom line is that just as moving your application onto .NET 10.0 may well have given you an instant performance boost with no real effort on your part (as did moving to .NET 9.0, before that, and .NET 8.0, before that, and .NET 7.0, before that, and .NET 6.0 before that) you may enjoy another boost upgrading to .NET 11.0. It is a more modest boost, but it's still a free improvement.
We've been running these benchmarks across 8 versions of .NET now (.NET Core 2, .NET Core 3.1, .NET 6.0, .NET 7.0, .NET 8.0, .NET 9.0, .NET 10.0, and .NET 11.0) enabling us to visualize how performance has improved across these releases for our library. (I've had to drop .NET Core 2 from these graphs because I couldn't get the benchmarks to run on this long-out-of-support runtime on my new machine.) First we'll look at the time taken to process 1 million AIS messages:
Each .NET release has brought improvements, so let's look at the version-over-version performance gains:
And next, the throughput in AIS messages per second (same benchmarks, just a different way to present the results):
Finally, let's look at the cumulative performance improvements since .NET Core 3.1:
Over the time the AIS.NET library has existed, performance for non-trivial processing has improved by well over double, thanks entirely to improvements in the .NET runtime!
Learn more about AIS.NET
You can learn more about our Ais.Net library at the GitHub repo, http://github.com/ais-dotnet/Ais.Net/ and in the same ais-dotnet GitHub organisation you'll also find some other layers, as illustrated in this diagram:

Note that there is a separate repository for Ais.Net.Models. And there's another for the Ais.Net.Receiver project. If you would like to experiment with this library, you will find some polyglot notebooks illustrating its use at https://github.com/ais-dotnet/Ais.Net.Notebooks