[erlang-questions] erlang performance

Lukas Larsson lukas@REDACTED
Thu May 15 10:07:46 CEST 2014


Hello,

On Wed, May 14, 2014 at 10:26 PM, Joe Armstrong <erlang@REDACTED> wrote:

>
> I'd like a have a rough idea of the average number of memory fetches and
> stores per Beam instruction and per Erlang reduction.
>
>
I recently did some digging into optimizing the code for the emulator and
created a tool that extracts the c-code and assembler output for each
instruction in beam. I did the checks for both PowerPC[1] and x86[2]. From
this you should be able to parse out how many fetches and stores each
instruction does. I don't know how many instructions there normally is per
function, but if you just take some random code and use
erts_debug:df(Module) you will get a file with one instruction per line and
then you can extrapolate.

I'm not sure what kind of performance indicator this will be though as you
have to know the cache hit rate and memory latency as well to judge how
long time each instruction takes. Also normally I've found that an Erlang
application spends about 50% of it's time executing code outside the
emulator loop (ets, gc, bifs etc).

Lukas

   [1]: https://dl.dropboxusercontent.com/u/6250179/asm_comparison_ppc.html(download
file for css to work, the new part is after some optimizations I
did for ppc only)
   [2]: https://dl.dropboxusercontent.com/u/6250179/asm_x86.html (download
file for css to work)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140515/1a408b36/attachment.htm>


More information about the erlang-questions mailing list