Re: inlining

2014-02-18 Thread Jeffrey Walton
On Tue, Feb 18, 2014 at 2:51 PM, atarob wrote: > Pankaj Mehta Wrote: > --- >> These should be covered during the link time optimisations. >> >> Look here for gcc: http://gcc.gnu.org/wiki/LinkTimeOptimization > > I was very much unaware of this. T

Re: inlining

2014-02-18 Thread atarob
Pankaj Mehta Wrote: --- > These should be covered during the link time optimisations. > > Look here for gcc: http://gcc.gnu.org/wiki/LinkTimeOptimization I was very much unaware of this. The linker actually compiles. Wow. Thanks. Posted at

Re: inlining

2014-02-17 Thread Maxim Dounin
wrong? How is that not a performance hit? In no particular order: - As already pointed out, smart enough compilers can inline whatever they want. - Adding all functions to .h files results in unmanagable code, so there should be a bar somewhere. - In many cases inlining may actually b

Re: inlining

2014-02-14 Thread Pankaj Mehta
These should be covered during the link time optimisations. Look here for gcc: http://gcc.gnu.org/wiki/LinkTimeOptimization And here for Visual Studio : http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx Cheers Pankaj On 14 February 2014 23:24, atarob wrote: > > On Friday, February 14, 20

Re: inlining

2014-02-14 Thread atarob
> On Friday, February 14, 2014 04:59:26 PM atarob wrote: > > Looking through the codebase, I see a lot of very short helper like > > functions that are defined in .c files with prototypes in .h files. > This > > means that the compiler cannot inline them outside of that .c file. > > Am I > > wrong?

Re: inlining

2014-02-14 Thread Styopa Semenukha
I suppose they will be inlined at -O2 level: http://linux.die.net/man/1/gcc -finline-small-functions Integrate functions into their callers when their body is smaller than expected function call code (so overall size of program gets smaller). The compiler heuristically decides which functions ar

inlining

2014-02-14 Thread atarob
Looking through the codebase, I see a lot of very short helper like functions that are defined in .c files with prototypes in .h files. This means that the compiler cannot inline them outside of that .c file. Am I wrong? How is that not a performance hit? Ata. Posted at Nginx Forum: http://foru