[erlang-questions] RecordA serialization ... time ... deserialization to RecordB?

Joel Reymont <>
Sat Nov 12 10:50:14 CET 2011


Don't serialize a dict.

Serialize a proplist, then use dict:from_list/1.

On Nov 12, 2011, at 9:22 AM, Max Bourinov wrote:

> Hello Erlangers!
> 
> So I made a dict as field of my state record and I do serialize it via term_to_binary and it seems to work like a charm.
> 
> One thing which makes me thinking about implementing my own serializer or dict like library - why dict data structure has many empty lists in it? Is it for the case of fast growing?
> 
> Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
> 
> Eshell V5.8.5  (abort with ^G)
> 1> D = dict:new().
> {dict,0,16,16,8,80,48,
>       {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
>       {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}}
> 
> Actually those empty lists doesn't hurt me much, but why? If nobody knows I will check sources :-)

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------




More information about the erlang-questions mailing list