Improve tests on serde interop
I honestly am lost in the forrest of serde traits, help would be appriciated.
From what I understood of serde:
- the
SerializeandDeserializetraits are there to map a user type to an serde internal representation/data model. - the
SerializerandDeserializertrait are there to map the serde data model to a external format. This is where the writing und parsing of the (file) format happens and where an external lib could be used to do that.
Having simd-json implements the Serialize and Deserialize traits for OwnedValue and BorrowedValue makes a DOM tree serializable to/deserializable from JSON using serde.
The implementation of the Deserializer trait means replacing the serde-json part that goes from JSON to serde data model by doing JSON --> Tape --> serde data model
Then this serde data model can go to user defined types or to OwnedValue or BorrowedValue. This second path is clearly slower than going without serde with JSON --> OwnedValue/BorrowedValue
Thanks! That's a nice explenation :). on the performance from we already solve that in a few ways, if we go str -> owned/borrowed Value we completely skip serde, it's mostly there so that people could do something like YAML -> Owned/Borrowed value or str -> their own struct (while to a degree simd_json_derive is a faster but less complete options here