[erlang-questions] Updating Myths of Erlang Performance

Björn Gustavsson bjorn@REDACTED
Sat Jun 4 08:13:07 CEST 2016

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.

Currently, I think that the following myths definitely should be retired.

2.1  Myth: Funs are Slow

2.2  Myth: List Comprehensions are Slow

Are any other myths dead?

I am considering adding a new myth, something like this:

"I thought binaries were always faster than lists, so why is binary
matching slower than list matching?"

Then there should be an example for both binaries and lists, something
like this:

f(<<B:/8,T/binary>>) ->
   %% Do something with B.
f(<<>>) ->
   %% Return something.

The answer should be that for more complicated binary patterns, binary
matching wins, and also that  the cost of using binaries vs. lists in
the entire application must be considered. Long lists or many short
lists in many processes will cost more in GC costs; then there are
different costs for sending binaries vs. lists as messages.

Are there any more myths I should consider?


Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list