-j
-j
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bytes can be ordered, though, and gob is all about turning things into bytes.
It might not be very efficient but, for example, if a specific map type implements the GobEncoder interface, it could simply get all keys, sort them and, then, make map lookups with the ordered keys to encode the data in a stable way.
Indeed. Buffering in general isn't particularly pleasant.But on the other hand, in this specific case: if the thing being encoded is already in memory, the buffer can't be worse than a 100% increase in memory, and we're already a GC'd language and GOGC=100 is the default anyway, so we're basically already cool with heap usage being double what's strictly required at any point.
Hi,The way forward here would be for you to fork gob and make your changes and learn from the experience what is important, what works and what doesn't, and then come back with a proposal for how to change gob. Making changes without that experience is a much tougher sell.
You may find that there are other more problematic points about gob that you haven't considered and that mean you need an entirely different encoding anyway. For example, I think you may be underestimating the effort involved in making other languages deal with gobs in a reasonable way, as well as the possible need for generic handling of gob-encoded streams when you don't have corresponding structs.
By all means, use gob or a forked gob to get off the ground quickly and learn more. Gob is a great choice for doing that. But I suspect you will learn both that gob is not the right long-term answer for this kind of use and what the important criteria are for what you replace it with.
-j