unexpected speedup by manual inlining

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

 



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

[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