-
Notifications
You must be signed in to change notification settings - Fork 1
Switch from Flatbuffers to ASN.1 ? #10
Comments
Trade studyThe ASN1 representation compared to flatbuffers, protobufs, and the current SPICE representation have been weighted. @pwnorbitals and I have decided to go ahead with ASN1 given the decision matrix below. Decision matrixEach item rates from 1 (worst) to 5 (best).
Detailed criteriaCompactnessHow small is the file on disk?
Note: these tests were done on the DE421.bsp file, looking specifically at the encoding of 64 bit floats. Spec clarityWhen reading the format specifications, how clearly is the message conveyed?
Network transferWhen transfering data across a network, how can the receiving party prepare for receiving the data?
ExtensibilityHow easy is it to extend these specifications?
Zero alloc readDoes reading required dynamic memory allocation with the standard tools?
Zero alloc write
Runtime parsingHow involved is the reading of the byte array and conversion to native types?
CertifiabilityIf we wanted to certify this format for use throughout the industry, how hard would that be?
Multi-archDoes it support big and little endian machines, and does it support many programming languages?
Subset serializationIf we wanted to serialize only part of what the specs provide (e.g. only a Vector3 and not a whole ephemeris), could we do that while following the specs and allowing for transfer of that information?
|
Great work from your side, @ChristopherRabotin. Incredible work :) |
ASN.1 is a highly efficient standardized platform-independent binary encoding used in lots of applications, including telecommunications and cryptographic key exchanges. This just looks amazing, seriously. Huge thanks to @pwnorbitals for letting me know about this.
Some references:
Note: all of the ASN.1 specs below can be tested directly on this playground: https://asn1.io/asn1playground/ .
Benchmark encoding sizes
One issue with the
der
library is that it does not support theReal
type defined in section 2.4 of the specs (PDF).Rebuilding the REAL type
Built-in
Encode:
DER: 26 bytes
Naive
Encode Pi:
DER: 14 bytes
Full specs
(Took me one hour to fix...)
Encoding a normal number:
DER: 14 bytes ( no overhead it seems!)
Encoding a subnormal number:
DER: 1 byte (yet, ONE!)
The text was updated successfully, but these errors were encountered: