Re: Tuning current tuplesort external sort code for 8.2

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tuning current tuplesort external sort code for 8.2
Date: 2005-10-04 09:55:58
Message-ID: 20051004095553.GB17589@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 04, 2005 at 12:37:51AM +0100, Simon Riggs wrote:
> On Mon, 2005-10-03 at 23:25 +0200, Martijn van Oosterhout wrote:
> > Please note: if inlineApplySortFunction() is actually inlined (it isn't
> > by default)
>
> Can you explain your last post some more. Thats not what I get.

The inline keyword is just a flag that you would like the compiler to
inline it. GCC will decide itself. It has a limit on the size of
functions that it will consider for inlining.

Quote the gcc manual:

-finline-limit-N
By default, gcc limits the size of functions that can be inlined.
This flag allows the control of this limit for functions that are
explicitly marked as inline (ie marked with the inline keyword or
defined within the class definition in c++). N is the size of
functions that can be inlined in number of pseudo instructions
(not counting parameter handling).

It goes in to say that the limit is 10000 for gcc 2.95, but if you
examine the manual for gcc 3.3 it has the limit at 600. So it's
entirely possible that at the time the person wrote that code, it *was*
being inlined, but it sure isn't on some versions of some compilers. I
experimented and found that -finline-limit-1500 causes it to start
inlining.

The -Winline flag causes gcc to print a warning if you specified
"inline" but gcc didn't inline it, for whatever reason.

Hopefully this clears that up.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-04 10:04:56 Re: [PERFORM] A Better External Sort?
Previous Message Simon Riggs 2005-10-04 09:51:22 Re: Vacuum and Transactions