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 Sat, 3 Apr 2010 20:46:27 +0000
David Holland <dholland-tech%netbsd.org@localhost> wrote:

> On Fri, Apr 02, 2010 at 04:14:47PM +0100, Sad Clouds wrote:
>  > I did another test, where I replaced a very simplistic "increment
>  > by one" function with "find first set" function.
>  > 
>  > I defined a total of 20 identical functions - fn_1() to fn_20().
>  > Built shared libraries and executables with 'gcc -O3'.
>  > Based on your suggestion, called 20 function in a loop 1,000,000
>  > times. [snip]
> 
> Did you compile both with -fPIC? That also affects performance,
> sometimes quite a bit.
> 
> -- 
> David A. Holland
> dholland%netbsd.org@localhost

Yes, both shared libraries were compiled with -fPIC. Joerg hinted that
accessing functions via pointers would be less efficient. I wanted to
find out how much of a performance hit this would make. I ran a few
tests and at least on i386 didn't see much difference.


Home | Main Index | Thread Index | Old Index