<div dir="ltr">Yeah I guess this idea is too much work for the debugger comparing to what we can earn from it.<div><br></div><div>@Nicolas Cellier</div><div>Currently the tempVector is always created at the beginning of the method, so the debugger is fine. The debugger can halt only on message sends / back jumps, so when you halt in a context to debug it, as the tempVector creation bytecodes are necessarily before the message send / back jump on which you halt, the tempVector is necessarily created before.</div>

<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/17 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">I had exactly same question yesterday coming to my mind, but isn&#39;t it yet like that?<br></div>
<div class="gmail_extra">
<br><br><div class="gmail_quote">2013/10/17 Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div><div>how about debugger<br></div>and accessing context state?<br></div>it going to be complicated, since at some stages temps not even allocated.<br>


</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 16 October 2013 14:53, Clément Bera <span dir="ltr">&lt;<a href="mailto:bera.clement@gmail.com" target="_blank">bera.clement@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



 <br><div dir="ltr">Hello,<div><br></div><div>Recently I realized that the tempVector is always created at the beginning of the method. In the case of:</div><div><br></div><div>foo</div><div>    | temp |</div><div>    true ifTrue: [ ^ self ].</div>





<div>    [ temp := 1 ] value.</div><div><br></div><div>It means that even if the execution flow goes to the quick return direction, the tempVector is created even if it is not used. I hacked a bit the compiler to lazily create the tempVector when needed (access to temp Vector variable or block closure creation), which means here the tempVector would be created just before the pushClosure bytecode and not at the beginning of the method.</div>





<div><br></div><div>I got as result that this specific method was executed 50,000,000 times per second instead of 21,000,000 times per second. Probably because of some useless garbage collection avoided.</div><div><br></div>





<div>The problem of this lazy tempVector initialization is that I never know where I am in the control flow graph. This means than in the case:</div><div><br></div><div>bar</div><div>    | temp |</div><div>    false ifTrue: [ temp := 1 ].</div>





<div>    [ temp := 2 ].</div><div><br></div><div>It is hard to detect where to add the extra bytecode for lazy tempVector initialization, because the first time you need it is in a branch, so if you create the tempVector in the branch and the execution flow goes in the other direction then the tempVector will not have been initialized.</div>





<div><br></div><div>Has any of you already investigated in this direction ? Does it worth it to implement that ?</div><div><br></div><div>Thanks for any answers.</div></div>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Igor Stasenko.
</div>
<br></blockquote></div><br></div>
<br></blockquote></div><br></div>