Skip to content
forked from ais-dotnet/Ais.Net

.NET Standard, high performance, zero allocation AIS decoder, which can process millions of AIVDM/AIVDO sentences per second on a single core. Sponsored by endjin

License

Notifications You must be signed in to change notification settings

fredeil/Ais.Net

 
 

Repository files navigation

Ais.Net

# Build Status GitHub license GitHub license IMM

.NET Standard, high performance, zero allocation AIS decoder, which can process millions of AIVDM/AIVDO sentences per second on a single core. Documentation is available at https://ais-dotnet.github.io/Ais.Net/

Supported Message Types

This library has been developed to support specific applications, so it only supports message types that have been needed to date in those applications. The following message types are currently supported.

ID(s) Name
1, 2, 3 Position Report Class A
5 Static Voyage Related Data
18 Standard Class B CS Position Report
19 Extended Class B CS Position Report
24 Static Data Report
27 Long Range AIS Broadcast message

See https://gpsd.gitlab.io/gpsd/AIVDM.html for a complete list of message types.

Performance

The benchmark suite is a work in progress, but it currently measures two basic scenarios: discovering message types, and extracting position data. Here are the results of executing these benchmarks on a system with an Intel Core i9-9900K CPU 3.60GHz CPU:

|                              Method |     Mean |    Error |   StdDev |     Gen 0 | Gen 1 | Gen 2 | Allocated |
|------------------------------------ |---------:|---------:|---------:|----------:|------:|------:|----------:|
| InspectMessageTypesFromNorwayFile1M | 347.5 ms | 3.960 ms | 3.704 ms | 1000.0000 |     - |     - |   3.57 KB |
|       ReadPositionsFromNorwayFile1M | 403.5 ms | 5.395 ms | 5.046 ms | 1000.0000 |     - |     - |   3.57 KB |

The test processes 1 million messages, so to get the per-message timings, we divide by 1 million (so ms in this table indicate ns per message). This demonstrates a per-message cost of 404ns to extract the position data, or 348ns just to inspect the message type. Note that these tests read data from a file, so this includes all the IO overhead involved in getting hold of the data to be processed. (These messages are in NMEA format by the way.)

Note that the 1000.0000 Gen 0 GCs is slightly misleading. BenchmarkDotNet reports the number of GCs per 1,000 executions of the benchmark. But in this case the benchmarks take long enough that it only executes them once each per iteration. The number it shows is the number of GCs multiplied by 1,000, then divided by the number of times it executed the benchmark (i.e. 1), so what this actually shows is that there was a single GC. We seem to see this whether we parse 1,000, 1,000,000, or 10,000,000 messages, so although we're not quite sure why we get an GC at all, the important point here is that the memory overhead is fixed, no matter how many messages you process.

Licenses

GitHub license

Ais.Net is available under the GNU Affero General Public License v3.0 (GNU AGPLv3) open source license. The AGPLv3 is a Copyleft license, and is ideal for use cases such as open source projects with open source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GNU Affero General Public License v3.0 obligations can be met.

Ais.Net is also available under a commercial license, which gives you the full rights to create and distribute software on your own terms without any open source license obligations. With the commercial license you also have access to official Ais.Net support and close strategic relationship with endjin to ensure your development goals are met.

For any licensing questions, please email [email protected]

GitHub license

The data used by the Ais.Net executable specifications and samples is licensed under the Norwegian license for public data (NLOD).

Project Sponsor

This project is sponsored by endjin, a UK based Microsoft Gold Partner for Cloud Platform, Data Platform, Data Analytics, DevOps, a Power BI Partner, and .NET Foundation Corporate Sponsors.

For more information about our products and services, or for commercial support of this project, please contact us.

We produce two free weekly newsletters; Azure Weekly for all things about the Microsoft Azure Platform, and Power BI Weekly.

Keep up with everything that's going on at endjin via our blog, follow us on Twitter, or LinkedIn.

Our other Open Source projects can be found at https://endjin.com/open-source

Code of conduct

This project has adopted a code of conduct adapted from the Contributor Covenant to clarify expected behavior in our community. This code of conduct has been adopted by many other projects. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

IP Maturity Matrix (IMM)

The IMM is endjin's IP quality framework.

Shared Engineering Standards

Coding Standards

Executable Specifications

Code Coverage

Benchmarks

Reference Documentation

Design & Implementation Documentation

How-to Documentation

Date of Last IP Review

Framework Version

Associated Work Items

Source Code Availability

License

Production Use

Packaging

About

.NET Standard, high performance, zero allocation AIS decoder, which can process millions of AIVDM/AIVDO sentences per second on a single core. Sponsored by endjin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 56.7%
  • Gherkin 43.3%