<html><head></head><body bgcolor="#FFFFFF"><div><br></div><div>1 jun 2012 kl. 10:46 skrev "José Valim" <<a href="mailto:jose.valim@gmail.com">jose.valim@gmail.com</a>>:<br><br></div><div></div><blockquote type="cite">
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">The '++' operator does not verify that the second argument is a list.</div>
Therefore, the compiler will rewrite the first expression to simply:<br>
<br>
[$F,$o,$o|Bar]<br></blockquote><div><br></div><div>Yes, thanks. <span style>For some weird reason I thought Erlang restricted the right side to be a list in such cases.</span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Have you made sure that you run each test in a newly spawned process? </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do you run the test for long enough time?<br></blockquote><div><br></div><div>Running in a newly spawned process did the trick, the results are now consistent.</div><div>I was already running it 1000 times, here is the code (without using spawn):</div>
<div><br></div><div><a href="https://www.refheap.com/paste/2954">https://www.refheap.com/paste/2954</a></div><div><br></div><div>I assume having a "clean" heap (reducing the chance of garbage collection) is the reason why it is a good idea to run benchmarks in a newly spawned process?</div>
</div></div></blockquote><div><br></div>If you want to vary one parameter in a test, make sure all other parameters stays the same otherwise you have no idea what you are measuring!<div><br></div><div>Code loading, heaps, position of mars .. Everything has to be taken into account.<br>
<br><br><blockquote type="cite"><div><div class="gmail_quote">
<div><br></div><div>Thanks Björn!</div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>erlang-questions mailing list</span><br><span><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a></span><br>
<span><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></span><br></div></blockquote></div></body></html>