_______________________________________________ erlang-questions mailing list erlang-q...@erlang.org http://erlang.org/mailman/listinfo/erlang-questions
MAP_SMALL_MAP_LIMIT)
gets an allocation from HASHMAP_ESTIMATED_HEAP_SIZE(SIZE) ==
(SIZE*3 + (2*SIZE/5)*2) which can severely exaggerate
the size of the map (details in erts/emulator/beam/erl_map.h).
There may be other impacts also, but that is unclear. Keeping maps
and dict/sets separate should be safest to avoid unintended changes
in legacy source code.It would affect everybody who saves the opaque data using an earlier
OTP version, then reads it in newer OTP version (e.g. after upgrade).
Or those who run two nodes on different OTP versions (e.g. during an
upgrade).
It would affect everybody who saves the opaque data using an earlier
OTP version, then reads it in newer OTP version (e.g. after upgrade).
Or those who run two nodes on different OTP versions (e.g. during an
upgrade).
On Tue, Apr 25, 2017 at 1:17 PM Attila Rajmund Nohl <attila...@gmail.com> wrote:
It would affect everybody who saves the opaque data using an earlier
OTP version, then reads it in newer OTP version (e.g. after upgrade).
Or those who run two nodes on different OTP versions (e.g. during an
upgrade).
I like to think of dict and sets to be "opaque" data structures. If you are relying on their internal representation, you will run into trouble. So changing the representation going forward should definitely be possible.
This leaves backwards compatibility. If the maps-optimized module can read and dynamically change old sets implementations into the new format on the fly, it may be possible to gradually replace the old representations with the new.
Some things to look out for in that process is data-at-rest, stored years ago in a database. At some point you would have to reprocess such data, or supply a conversion module which can handle these old formats.
I also think that any system must provide some measure of pushing things forward. That is, each major release of Erlang could contain a limited set of things you now have to do differently, with a clear upgrade path from earlier versions. As long as the set is limited, we can probably handle the rewrites needed. If you value backwards compatibility for forever, you run the risk of getting stale, never upgrading anything.
As for the increased memory copy pressure: I think this should be fixed in the context of "maps" and not be part of the argument as to why one would keep the old sets representation.