riebl / vanetza

Open-source implementation of the ETSI C-ITS protocol stack
Other
197 stars 157 forks source link

asn1: OER-based copy for asn1c wrapper #219

Closed v0-e closed 5 months ago

v0-e commented 5 months ago

May I suggest the use of OER to do the roundtrip-based copy of ASN.1 types? Unless there are any concerns with the implementation/safety of asn1c's OER, we can consider it over the current BER/DER copy since it is much faster.

A benchmark of 1000000 roundrip encoding/decodings of a zero-initialized CAM with some fields set to 1 to pass the constraint checks:

OER Roundtrip in 3.370587 s   // (canonical)
BER Roundtrip in 14.393260 s  // der -> ber
PER Roundtrip in 3.833098 s   // (canonical unaligned)
JER Roundtrip in 10.260315 s  // (minified)
XER Roundtrip in 14.103931 s  // (canonical)
riebl commented 5 months ago

Fine for me :-)