[erlang-questions] Store maps in ets/dets?
Michael Loftis
mloftis@REDACTED
Thu Apr 10 18:14:05 CEST 2014
On Thu, Apr 10, 2014 at 2:09 AM, Jesper Louis Andersen
<jesper.louis.andersen@REDACTED> wrote:
> 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.
>
I think you might mean the opposite here....that maps is ephemeral and
ETS is persistent (or can be persistent using DETS anyway)
> 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
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
>
>
> --
> J.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
--
"Genius might be described as a supreme capacity for getting its possessors
into trouble of all kinds."
-- Samuel Butler
More information about the erlang-questions
mailing list