[erlang-questions] list vs binary performarnce, destructuring and consing

Motiejus Jakštys desired.mta@REDACTED
Tue Oct 23 10:57:48 CEST 2012


On Tue, Oct 23, 2012 at 9:50 AM, Motiejus Jakštys <desired.mta@REDACTED> wrote:
> On Tue, Oct 23, 2012 at 9:07 AM, Martynas Pumputis <martynasp@REDACTED> wrote:
> Session:
> 1> t:bench().
> Creating str of size 1048576.. done.
> Converting to binary.. done.
> Executing STR copy 30 times... done.
> Executing BIN copy 30 times... done.

Even this benchmark is not fair, because while STR is doing its work,
Erlang VM is allocating more and more memory from the OS. And then
binary has a sufficiently large heap in the VM to work on.

To be fair, we should run both string copy and binary copy before
doing the benchmarks, just to "warm up" the VM. Tried it, but doesn't
seem to help.


-- 
Motiejus Jakštys



More information about the erlang-questions mailing list