On Sat, Jan 17, 2009 at 9:46 AM, Phil <span dir="ltr">&lt;<a href="mailto:pbeadling@mail2web.com">pbeadling@mail2web.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">In the second example we probably have something like 6 'JMP' statements in machine code – 3 to jump in to each function, and 3 to jump back out. &nbsp;In the first we have 2 – one to jump us into mcSimulate and one to return. &nbsp;So each iteration executes 4 more JMPs in the second example. &nbsp;All others things being equal this will produce slightly less efficient code.</span></font></font></div>
</blockquote><div><br>Wow.&nbsp; I strongly suggest you forget about efficiency completely and become a proficient high-level haskeller, and then dive back in.&nbsp; Laziness changes many runtime properties, and renders your old ways of thinking about efficiency almost useless.<br>
<br>If you are interested, though, you can use the ghc-core tool on hackage to look at the core (lowish-level intermediate language) and even the generated assembly for minimal cases.&nbsp; It&#39;s dense, but interesting if you have the time to study it.<br>
<br>Others will know more about this specific speculation than I.<br><br>Luke</div></div><br>