Replies: 1 comment
-
We have this for strings of course in some languages. Doing it for tables sounds pretty "heavy" to me in cost, and it seems that use cases of sharing tables are fairly niche, i.e. the user will be very aware if they want it, or not. That said, nothing against providing it as an option if its useful. I guess the first step would an optional Of course, none of this should ever be automatically on, not just in terms of cost, but also because it would interfere with |
Beta Was this translation helpful? Give feedback.
-
This is an open question for now as I haven't done much research.
Flex/Flat protocol has the concept of reference, which create interesting properties to the payload, such as enabling random access without parsing and deduplicating data by just keeping one instance of the data and insert the reference to it for every other entry.
By exposing an API to add those "references", users can manually perform the deduplication. This is a straightforward approach and already can save a lot of data. But at cost of hand-coding those checks.
My question now is: Is it possible to automatically add branch deduplication, automatically, and efficient enough to be used in real scenarios?
An initial naive solution that come to mind is: Before writing
maps
andarrays
into the buffer, we calculate it's hash we compare against previously stored hashes of the same type. If we have a match we deeply compare both branches and adds areference
if they are deeply equal.Other things it comes to mind:
Beta Was this translation helpful? Give feedback.
All reactions