[erlang-questions] Updating Myths of Erlang Performance

Fred Hebert mononcqc@REDACTED
Sun Jun 5 14:19:16 CEST 2016


On 06/04, Björn Gustavsson wrote:
>We think that it is time to  update the Myths of Erlang Performance in
>the Efficiency Guide. Some myths have probably died by now and some
>new may have arisen.
>
>I am open to suggestions for myths to retire (move to a separate
>section at very end of the guide) and new myths to add.

One I persistently see, and which is likely a consequence of how we 
teach Erlang and set up exercises, is that tail recursion is always the 
best choice and likely faster than body recursion.

In cases where all your function does is build a new list (or any other 
accumulator whose size is equivalent to the number of iterations and 
hence the stack) such as map/2 over nearly any data structure or say 
zip/2 over lists, body recursion may not only be simpler, but also 
faster and save memory over time.

I had covered this in an old blog post at 
http://ferd.ca/erlang-s-tail-recursion-is-not-a-silver-bullet.html




More information about the erlang-questions mailing list