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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Apr 17 20:43:30 UTC 2016


AFAICT, cDigitCompare:with:len: is inlined by clang.
But the interpreterProxy messages are not inlined, but it's not really
amazing, these are different units of compilation.
The procedure I used for checking was:

vim ../common/Makefile.flags (add option -S to CFLAGS)
touch ../../src/plugins/LargeIntegers/LargeIntegers.c
mvm -f
less build/LargeIntegers/LargeIntegers.o

And you are certainly right, compared to a few bit ops, the function
calls/return/stack handling are expensive.
So inlining should make a measurable difference for "small" large integers.
I was biased by giant integers which is more what I'm after (tight loops)

Nicolas

2016-04-17 0:59 GMT+02:00 Levente Uzonyi <leves at caesar.elte.hu>:

>
> Hi Nicolas,
>
> It's been a while I optimized C programs, but I'm pretty sure function
> calls cost a lot compared to a few direct instructions (e.g.
> isIntegerObject).
>
> Levente
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160417/9a6f554f/attachment-0001.htm


More information about the Vm-dev mailing list