Strings (was: Re: are Mnesia tables immutable?)

Yariv Sadan <>
Thu Jun 29 21:46:06 CEST 2006


>
> The apps I develop are mostly data in / data out with some nice
> presentation and validation on what goes in.  This means that the
> majority of memory is taken up by strings as most of my data is text
> of some form or another.  I don't need benchmarks to know that 4
> bytes per character is _too_ much.  In most cases its 4x too much and
> going to 64-bits is off limits with this type of memory allocation.
> Add to that the intermittent copying of these lists of integers (one
> page request could trigger 20 copies of lengthy lists of lists of
> integers in memory...just to stream out a page containing drop down
> lists that don't change very often)... and you will get spikes of
> memory allocation as the number of page requests grows.  It turns out
> that processor performance, io, concurrency issues won't be my first
> bottleneck...it will be memory taken up by strings!!!
>

Ke Han,
>From your description, It sounds like the rule of thumb web developers
should follow is to avoid strings whenever possible and use binaries
instead, especially on 64 bit machines. Would you say that's a fair
interpretation? I'm just looking for a short term solution here
because I don't expect Erlang string handling to change much in the
near future.

Thanks,
Yariv



More information about the erlang-questions mailing list