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)
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: