tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Small ld.elf_so speed up



On Thu, Apr 01, 2010 at 09:56:17PM +0100, Sad Clouds wrote:
> Joerg I did a few tests and they seem to indicate that declaring
> functions 'static' and then exporting them via function pointers is not
> more expensive, but quite the opposite.

Your test case isn't really reflecting real world usage as it is blowing
away the branch caches. It looks quite different in terms of performance
when you use a tight loop of few functions. The size difference is not
really a surprise as direct linkage has to export the names etc.

The function pointer array approach works and is the best way to handle
modules, e.g. when you have to deal with function pointers anyway.
Otherwise it is generally an inferior calling convention.

Joerg


Home | Main Index | Thread Index | Old Index