3 ms·
Why would it make more sense? You'd first have to sort the keys, then pretty print, then diff: https://www.jvt.me/posts/2020/08/24/pretty-print-json-diff/ http
by lichtenberger 4y ago
Why would it make more sense? You'd first have to sort the keys, then pretty print, then diff:
https://www.jvt.me/posts/2020/08/24/pretty-print-json-diff/ https://www.jvt.me/posts/2020/08/24/pretty-print-json-diff/
I'm also using a JSON-diff format in my data store[1], which is accumulated during insertions/updates/deletes in-memory and serialized during a commit, admittedly for large JSON instances (a few Gb and much more).
[1] https://github.com/sirixdb/sirix https://github.com/sirixdb/sirix
- gwbas1c 4y ago> You'd first have to sort the keys A lot of that comes down to internal application architecture. If you're working in Javascript / Typescript, where objects are inherently dictionaries / hashsets with ordering; yes, this is true. You will need to sort before serialization in order for the diff to be useful. But: If you're working in a strongly-typed language like C# / Java / Rust / C++, and using an object -> JSON -> object serializer; the order of the elements is often quite explicit and never changes.