[erlang-questions] performance vs msg queue length
Wed Apr 21 00:58:31 CEST 2010
Matthew Sackman wrote:
> 3. You are constructing ever longer lists of 'ok' atoms. Doing a
> recursive loop with counter would avoid this, and so you would get down
> to timings of doing the actual receives.
I'd considered that one too, but I think the inner list comprehension
falls squarely into the "result obviously not used" category that allows
the compiler to optimise away result storage (see the optimisation guide
and a thread a month or so back discussing this). Out of curiosity I
replaced the list comprehension with a lists:foreach() (which always
doesn't store results)and the results were actually marginally (though
not hugely) worse across the board.
More information about the erlang-questions