unexpected speedup by manual inlining
Rohit Garg
rpg.314@gmail.com
Tue Oct 28 13:24:00 GMT 2008
Hi all,
I have a small app. In it in a a particular place, I had a 2-3
functions being called from one main function. They were small
functions (5-6 lines) and inline keyword was used. The performance was
......... HORRIBLE.
-Winline didn't report any case of a function not being inlined.
I didn't know where to start. So I manually inlined these functions.
They are very small and quite trivial. The program now shows ~60x
speed-up in that part of the code. I have no idea what's the cause of
this dramatic speed up. But I suspect it is because I am using g++ to
make a shared library. All the functions referred to here are in one
file. It is complied by using a -c -fPIC option to make a .o file.
Several .o files are later packed together into a .so file using a
-shared option.
Is my guess correct?
--
Rohit Garg
http://rpg-314.blogspot.com/
Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay
More information about the Gcc-help
mailing list