3 ms·
ASN.1 does not map well to any meaningful and generic in-memory representation (I tried to do that in dfsch's BER/DER module and failed spectacularly), while JS
by dfox 16y ago
ASN.1 does not map well to any meaningful and generic in-memory representation (I tried to do that in dfsch's BER/DER module and failed spectacularly), while JSON does, but modifing BER to be efficient json-like representation is not that complex, basic idea is to large extent similar. And as for efficiency and ease of use, if you want efficient dataformat with fixed schema, XDR is certainly better than PER (and free of ASN.1's design-by-comitee nonsense)
- prodigal_erik 16y agoI/O is relatively so expensive now that deserializing packed fields is more efficient than transmitting enough padding to make them usable in-place. Some people claim they can do compression and come out ahead on the reduction in sends and recvs and copies.
- dfox 16y agoMy take on efficiency of serialisation is more concerned with resulting data size, not actual coding/decoding processing overhead. ASN.1 encodings are mostly concerned about size and not about direct usability of encodings (both PER and BER actually use UTF-8 like encodings for various values, PER even does not align fields to byte boundaries). And as for compression: dfsch's binary serialization format does some de-facto dictionary compression on some fields and it actually speeds up decoding itself (decoder caches various high-level metadata in decompressor's dictionaries), not only reduces I/O size.