Erlang Efficiency quesitons

Francesco Cesarini <>
Wed Mar 14 18:38:59 CET 2001

> Why, Francesco, don't you know that we shouldn't worry about making
> our programs fast?!  ;-)

Search some of my earlier posts on this list and you will find the:

First make it work. Then make it beautiful. Then if you really really
have to, make it fast (While keeping it beautiful and correct). 

(And as I say when teaching, in 95% of the cases, your application will
be fast enough. For the remaining 5%, you do not have the time to
rewrite it... At least it is beautiful :-)

> To my knowledge, there is no such document.

Let us put one together. Here are some more hints:

* Use binaries when shuffling around large amounts of data between
* Some one on the list had mentioned that appending binaries results in
them being copied, thus avoid it.
* In the documentation for the 4.4 extensions I found a note that 
  f(X) when X == #rec{x=1, y=a} -> ... is less efficient than
 f(#rec{x=1, y=a} = X) -> ... 

I assume because in A X is bound before the guard test, in B, the
pattern match fails as soon as one of the conditions does not match.
Back in the good old days, the recommendation was to use guards in Beam,
while with the Jam there was no difference... 

If you have found more through timing or somewhere hidden in the
documentation, send them directly to me and I will put together a web

Francesco Cesarini

Erlang/OTP consultant
Cellular: INT+44-7776 250381 
ECN: 832-707192

More information about the erlang-questions mailing list