From: Doug B. <dou...@ya...> - 2012-04-03 07:00:49
|
Gang: On modern processors, the problem of branch prediction is more important than subroutine call/returns, so inline code is not where your focus should be. Subroutine call/returns are fully predictable whereas a simple if <condition> statement is NOT. I have found that inlining only helps on the most trivial piece of code (on Intel 386 etc) and the compiler does a good job on doing it for you. MACRO's are a waste of time, IF used for improving performance. I now use them onlyto abbreviate/document trivial things or to make simple changes to test code in a 1000 places. doug Doug Baskins <dou...@ya...> >________________________________ > From: Jim Lloyd <jl...@si...> >To: aj...@fr... >Cc: dou...@ya...; jud...@li...; sta...@gm... >Sent: Tuesday, April 3, 2012 4:05 AM >Subject: Re: I'd like to congratulate you and the team that worked on Judy Arrays > > >On Mon, Apr 2, 2012 at 11:35 AM, Alan Silverstein <aj...@fr...> wrote: > >Amusing, it reminds me that in the last year I carefully marked some new >>source functions "inline", but later discovered that gcc was basically >>ignoring my advice and doing whatever the heck it wanted. Turns out >>"inline" is merely a suggestion, and I don't know of a way to force it >>("I know what I'm doing and I want to waste space for performance") >>other than reverting to macros. (Maybe there's some gcc option or >>#pragma I didn't look for...) >> > >See http://gcc.gnu.org/onlinedocs/gcc/Inline.html > > >Here is a macro that does the trick: >#define force_inline inline __attribute__((always_inline)) > > >------------------------------------------------------------------------------ >Better than sec? Nothing is better than sec when it comes to >monitoring Big Data applications. Try Boundary one-second >resolution app monitoring today. Free. >http://p.sf.net/sfu/Boundary-dev2dev >_______________________________________________ >Judy-devel mailing list >Jud...@li... >https://lists.sourceforge.net/lists/listinfo/judy-devel > > > |