XML and Erlang

Ulf Wiger (AL/EAB) <>
Thu Jun 23 11:08:00 CEST 2005


Richard A. O'Keefe wrote:
>
> It looks as though the biggest space win for Erlang might be 
> representing parsed character data and attribute values other
> than enumeration values as binaries rather than lists.

Presumably, with string=atom, you would get the added advantage
of "compression", since each unique atom is stored only once,
which is not usually the case for binaries (you'd have to implement
your own binary cache on the heap in order to reuse pointers,
but this would be useless if the aim is to reduce the size of the 
external representation).

It would of course also bring the added disadvantage of potentially
filling the atom table, since it's not garbage collected, and 
cannot be manually purged either.

Looking at the external representation, you can disregard the atom
cache, and each atom would take about (exactly?) the same space as a 
corresponding binary.


/Uffe



More information about the erlang-questions mailing list