<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This is fantastics work. Really nice.<div><br><div>For Joe may I suggest to use the <a href="http://github.com/tonyrog/beam">github.com/tonyrog/beam</a> (or similar),</div><div>a beam emulator written in Erlang, and perform simulations instead.</div><div>The number of registers and memory cache size and speed will vary anyway.</div><div>With a simulator you can change all parameters without getting your hands dirty :-)</div><div><br></div><div>The beam emulator is not complete and do/will only cover the external instructions.</div><div>That does not stop anyone from implementing the loader and the internal instructions</div><div>as well.</div><div><br></div><div>/Tony</div><div><br></div><div><br></div><div><br><div><div>On 15 maj 2014, at 10:07, Lukas Larsson <<a href="mailto:lukas@erlang-solutions.com">lukas@erlang-solutions.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello,<div><br></div><div>On Wed, May 14, 2014 at 10:26 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><br></div><div>I'd like a have a rough idea of the average number of memory fetches and</div><div>stores per Beam instruction and per Erlang reduction.</div><div><br></div></div></blockquote></div>
<div><br></div><div>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. </div>
<div><br></div><div>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).</div>
<div><br></div><div>Lukas<br><div class="gmail_extra"><br></div><div class="gmail_extra">   [1]: <a href="https://dl.dropboxusercontent.com/u/6250179/asm_comparison_ppc.html">https://dl.dropboxusercontent.com/u/6250179/asm_comparison_ppc.html</a> (download file for css to work, the new part is after some optimizations I did for ppc only)</div>
<div class="gmail_extra">   [2]: <a href="https://dl.dropboxusercontent.com/u/6250179/asm_x86.html">https://dl.dropboxusercontent.com/u/6250179/asm_x86.html</a> (download file for css to work)<br><br><div class="gmail_quote">
<div> </div></div></div></div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">"Installing applications can lead to corruption over time. </span><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></div></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>