This is the mail archive of the
mailing list for the GCC project.
unexpected speedup by manual inlining
- From: "Rohit Garg" <rpg dot 314 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 28 Oct 2008 14:23:49 +0100
- Subject: unexpected speedup by manual inlining
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
-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
Is my guess correct?
Department of Physics
Indian Institute of Technology