Re: profiling connection overhead

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Subject: Re: profiling connection overhead
Date: 2010-11-29 17:50:08
Message-ID: AANLkTimdgS0nJ4wEBKkX2AZJDejLtQYOCHa7_69jeHrG@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 29, 2010 at 9:24 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On Monday 29 November 2010 17:57:51 Robert Haas wrote:
>> On Sun, Nov 28, 2010 at 11:51 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> >> Yeah, very true.  What's a bit frustrating about the whole thing is
>> >> that we spend a lot of time pulling data into the caches that's
>> >> basically static and never likely to change anywhere, ever.
>> >
>> > True.  I wonder if we could do something like the relcache init file
>> > for the catcaches.
>>
>> Maybe.  It's hard to know exactly what to pull in, though, nor is it
>> clear to me how much it would really save.  You've got to keep the
>> thing up to date somehow, too.
>>
>> I finally got around to doing some testing of
>> page-faults-versus-actually-memory-initialization, using the attached
>> test program, compiled with warnings, but without optimization.
>> Typical results on MacOS X:
>>
>> first run: 297299
>> second run: 99653
>>
>> And on Fedora 12 (2.6.32.23-170.fc12.x86_64):
>>
>> first run: 509309
>> second run: 114721
> Hm. A quick test shows that its quite a bit faster if you allocate memory
> with:
> size_t s = 512*1024*1024;
> char *bss = mmap(0, s, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_POPULATE|
> MAP_ANONYMOUS, -1, 0);

Could you post the program?

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?

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-29 17:50:12 Re: profiling connection overhead
Previous Message Andres Freund 2010-11-29 17:49:12 Re: profiling connection overhead