[Vm-dev] Re: primitiveDigitCompare is slow (was: Re: [squeak-dev] The Inbox: Kernel-dtl.1015.mcz)

Levente Uzonyi leves at caesar.elte.hu
Sat Apr 16 22:47:35 UTC 2016


On Sun, 17 Apr 2016, Levente Uzonyi wrote:

>
> I just played around a bit with the code generator and I think there other 
> reasons why the code is slow:
> - 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.

Perhaps gcc can automatically inline these with the -flto switch.

Levente

> - #cDigitCompare:with:len: doesn't get inlined, even though it's a tail call. 
> That's probably a limitation of the Slang inliner, or a bug.
>
> 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:.
> While this doesn't have a direct effect on execution time, it may affect the 
> CPU cache.
> I think the best would be to not generate any C code from such methods.
>
> Levente
>


More information about the Vm-dev mailing list