[erlang-questions] Store maps in ets/dets?
Jesper Louis Andersen
Thu Apr 10 11:09:24 CEST 2014
The semantics of maps is that of a persistent data type. ETS is ephemeral.
So the fit is not good. Furthermore, maps are living int he process heap
and thus, they are automatically garbage collected. ETS is manually
collected in contrast. So the fit is even worse.
Maps currently has no order (based on maps:map/2 and maps:fold/3), which
means they can be implemented as HAMTs (like in Clojure) once they grow
large. This has very good runtime behaviour, while keeping the process
semantics intact. The other option is to give maps order, but then we can't
use digital searching techniques anymore and must resort to balanced search
trees, e.g., AVL or RB trees and friends.
The current representation is very memory efficient however. It will
probably be very good for small maps with a keyset that doesn't change.
On Thu, Apr 10, 2014 at 10:41 AM, Max Lapshin <max.lapshin@REDACTED> wrote:
> Maybe I have missed something and failed to google this info, but are
> there any plans to store maps in ets?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions