Reduce fpic related slowdowns

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

 



Hi,
I am currently trying to move some parts of a bigger program to an external 
library that can be used to process a big amount of data. This is done because 
different frontends should be able to use the library. It only has some 
functions to set extra data, but most of it is done by invoking a single 
function which reads a buffer and starts some functions as reaction. So it 
just interprets the data. The first try to compile it using -fPIC results in a 
massive slowdown (~20%), but this could be reduced by compiling with -
fvisibility=hidden. The compiler now reduced the start block in each function 
slightly and we only had a slowdown of ~5%. Next idea was to mark all 
functions which are only used by the interpreter function as internal. We 
don't pass that functions to the outside and they shouldn't be callable - my 
idea was that is should now as fast as it was before as the init block in 
internal functions could be dropped and replaced by an easier init block which 
is similar to the non-PIC block. This doesn't happen here and the results are 
the same as with using -fvisibility=hidden.
Is this not possible or just not implemented by gcc at the moment? Are there 
maybe other ways to reduce the speed penalty due to -fPIC without removing the 
internal functions.

Target architectures are currently i386 and amd64 - so disabling PIC isn't 
possible on amd64.
-- 
Robert Wohlrab

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux