Re: profiling connection overhead

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Bruce Momjian <bruce@momjian.us>, pgsql-hackers@postgresql.org, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Date: 2010-11-30T07:21:29Z
Lists: pgsql-hackers
On Monday 29 November 2010 19:10:07 Tom Lane wrote:
> Jeff Janes <jeff.janes@gmail.com> writes:
> > Are you sure you haven't just moved the page-fault time to a part of
> > the code where it still exists, but just isn't being captured and
> > reported?
> 
> I'm a bit suspicious about that too.  Another thing to keep in mind
> is that Robert's original program doesn't guarantee that the char
> array is maxaligned; though reasonable implementations of memset
> should be able to use the same inner loop anyway for most of the
> array.
Yes, I measured the time including mmap itself. I don't find it surprising its 
taking measurably shorter as it can just put up the mappings without 
explicitly faulting for each and every page. The benefit is too small to worry 
though, so ...

The answer to Robert includes the timings + test program.

Andres