<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 25, 2017 at 4:11 AM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
</span>Sorry to reply to my own post, but I need to retract this. The profiler<br>
shows that a big portion of the time is spent in<br>
<br>
    LargePositiveInteger(Integer)><wbr>>digitDiv:neg:<br>
<br>
I mistakenly assumed that primDigitDevNegative was not implemented for<br>
the LargeIntegers module, but that is wrong, I see now that function<br>
primDigitDivNegative() is implemented in the translated plugins. So maybe<br>
it is not an efficient implementation when translated to JavaScript?<br></blockquote><div><br></div><div>It certainly is not efficient, and I did not yet try to improve its efficiency, but it is faster than the fallback code:</div><div><br></div><div><a href="https://github.com/bertfreudenberg/SqueakJS/blob/master/plugins/LargeIntegers.js#L1798">https://github.com/bertfreudenberg/SqueakJS/blob/master/plugins/LargeIntegers.js#L1798</a><br></div><div><br></div><div>What is the range of your LargeIntegers? SqueakJS does not implement most of prims 30-37, whereas the C VM at least does so with up to 64 bits IIRC?</div><div><a href="https://github.com/bertfreudenberg/SqueakJS/blob/master/vm.js#L4301">https://github.com/bertfreudenberg/SqueakJS/blob/master/vm.js#L4301</a></div><div><br></div><div>This is just laziness on my part (since the fallback + plugin works), there's no good reason not to implement a fast path for these if the numbers fall within the 53 bit range JS can handle directly. We do have the code for 31 bit SmallInts, so this should be relatively simple.</div><div><br></div><div>These prims could even be made to handle arbitrary-sized large ints (in which case the plugin wouldn't even be needed, and it would likely be much faster) but getting the semantics exactly right is not trivial.</div><div><br></div><div>- Bert - <br></div></div></div></div>