[erlang-questions] how to do faster integer operations (was: some language changes)

Matthias Lang matthias@REDACTED
Thu Jun 7 08:58:04 CEST 2007


Paul Mineiro writes:

 > It's been a good lesson to discover that using less than the full machine
 > width for integers leads to significant speed up.  Is there a FAQ for
 > performance where this kind of knowledge is accumulated?

I've shied away from putting optimisation tricks in the FAQ. Taking
the current information as an example, I could write something like:

  Q: I have some limited-width-integer-intensive code which I want
     to speed up, what do I do?

  A: If the integer width is within a few bits of 32 bits and you're
     running on a 32 bit CPU, try moving to a 64 bit machine.

It doesn't seem like a _frequently_ asked question, it's terribly tied
to the state of hardware right now, and, last but not least, I find it
hard to get excited about a radical speedup which improves things to
"only" 10x slower than the straightforward answer, which is "do it in C".

I'm still secretly hoping that someone will find neat improvement.

Matthias



More information about the erlang-questions mailing list