Wolfgang Wieser wrote:
>> The trick is that having the code inline reduces call overhead, which
>> accounts for about 10% to 15% for the average isosurface function.
>>
> This is correct. Actually, it seems the dynamically linked function call
> overhead is the only disadvantage of my approach concerning performance.
> I actually don't know exactly what the CPU cycles get spent on:
>
> (*int_func)(bar); // <-- internal function
> (*ext_func)(bar); // <-- external function (dynamically linked)
>
> In C code it looks completely identical but the second one has
> at least 10 times more call overhead.
>
This is wrong. I tricked myself: In the above program, the int_func was
not a pointer to a function but the function itself.
More measurements show that the overhead is NOT due to
external shared object "linkage" but due to the function being called via
a function pointer - not depending on whether the function is in the
primary code or in a shared object.
Wolfgang
Post a reply to this message
|