<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-04-17 0:36 GMT+02:00 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I just played around a bit with the code generator and I think there other reasons why the code is slow:<br>
- the use of function calls instead of macros for isIntegerObject, slotSizeOf, success, failed, stackValue. I suspect that the VM internally uses macros for these in numbered primitives.<br></blockquote><div><br><div><br></div>Hi Levente,<br></div><div>But currently we generate single code source for plugins whatever VM flavour, so the macro if any should be defined in VM specific repository... That sounds a bit like what Eliot was suggesting for fetching the class though (if I understood correctly).<br><br></div><div>My opinion is that suppressing function call overhead will make little difference since these calls  are pre-conditions sent once or twice per primitive.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- #cDigitCompare:with:len: doesn&#39;t get inlined, even though it&#39;s a tail call. That&#39;s probably a limitation of the Slang inliner, or a bug.<br>
<br></blockquote><br><div>I&#39;m working on Slang type inference and inlining (they are closely bound), but I don&#39;t think it really matters for this specific call. More so for unsafeDigitAt &amp; co which might be used in tight loops.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Some functions are generated as static, even though they are never called, because they have been inlined during the code generation. E.g.: #digitCompareLarge:with:.<br>
While this doesn&#39;t have a direct effect on execution time, it may affect the CPU cache.<br>
I think the best would be to not generate any C code from such methods.<span class=""><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>I wonder if I did not see code for eliminating these... I&#39;ll check again.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
Levente<br>
</font></span></blockquote></div><br></div></div>