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 10:37:47
Message-ID: 20051004103742.GD17589@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 04, 2005 at 11:55:58AM +0200, Martijn van Oosterhout wrote:
> 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.

From searching the web, it appears the inline limit was dropped from
10000 to 600 between gcc 3.0.0 and 3.0.1 in response to complaints
about gcc memory usage. Any function that could be inlined needed to be
kept in memory in semicompiled form and in C++ where lots of inlinable
functions call eachother, the memory usage blew up completely.

The difference between -O2 and -O3 is that the latter will consider any
function for inlining, even if you didn't ask. For C programs that
basically means any function declared static. Also, the number is
"pseudo-instructions" and their meaning can change from version to
version.

Since we're pretty much relying on gcc to inline for performance, I
still think we should add -Winline by default so we can tell when it's
not doing what we want.

Hope this helps,
--
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 Peter Eisentraut 2005-10-04 11:01:41 New pg_config behavior
Previous Message Martijn van Oosterhout 2005-10-04 10:04:56 Re: [PERFORM] A Better External Sort?