[erlang-questions] Optimization for the ++ operator
Fri Jun 1 10:46:28 CEST 2012
> The '++' operator does not verify that the second argument is a list.
> Therefore, the compiler will rewrite the first expression to simply:
Yes, thanks. For some weird reason I thought Erlang restricted the right
side to be a list in such cases.
> Have you made sure that you run each test in a newly spawned process?
Do you run the test for long enough time?
Running in a newly spawned process did the trick, the results are now
I was already running it 1000 times, here is the code (without using spawn):
I assume having a "clean" heap (reducing the chance of garbage collection)
is the reason why it is a good idea to run benchmarks in a newly spawned
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions