[erlang-questions] Input too fast, shootout and very weird behaviour with binaries

Per Melin <>
Wed Jul 18 04:24:19 CEST 2007



Paulo Sérgio Almeida wrote:
> 
> Then I wrote a version using binaries, thinking it would be better, and 
> a very weird thing happened. Memory comsumption stayed very low, about 
> 80MB, but it took almost 53 MINUTES to finish, always maxing CPU usage. 
> 


I recognize the problem. I've been trying to optimize a program that
shuffles around a lot of binaries, and I've had a hard time making sense of
the huge impact on performance the smallest change can have.

The execution time of the second version of your program is far from linear.
It's really visible once the input file is larger than ~300K.

With a 320K file it spends 43% of the time in the garbage collector
according to fprof.

With a 640K file it's 61% time in the GC, 1280K makes it 80% and at 2560K
it's 89%.

I've tweaked the program so it runs about three times as fast, but I can't
get rid of the exponential characteristics.

I'm using R11B4 without HiPE.

-- 
View this message in context: http://www.nabble.com/input-too-fast-tf3983101.html#a11661365
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list