Re: Rethinking MemoryContext creation

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Rethinking MemoryContext creation
Date: 2017-12-11 18:17:14
Message-ID: 20171211181714.ddfgdnwm6kwusyq6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017-12-11 13:09:42 -0500, Tom Lane wrote:
> Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> writes:
> > On 12/10/2017 04:42 PM, Tom Lane wrote:
> >> Peter Geoghegan <pg(at)bowt(dot)ie> writes:
> >>> On Sat, Dec 9, 2017 at 5:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>>> Overall I'm seeing about a 5% improvement in a "pgbench -S" scenario,
> >>>> although that number is a bit shaky since the run-to-run variation
> >>>> is a few percent anyway.
>
> > FWIW I've done some measurements, and while there is a improvement, it's
> > far from 5%. ...
> > So that's about 1.3% and 1.2% improvement. It seems fairly consistent,
> > but it might easily be due to different in layout of the binaries.
>
> Thanks for checking. With these sorts of small-percentage improvements,
> I would not be surprised for platform-to-platform results to be different.
> At least you do see some improvement too.
>
> Let me code up the change to avoid copying constant name strings,
> and then we can see if that helps any.

FWIW:
+ 5.37% postgres postgres [.] hash_search_with_hash_value
+ 2.94% postgres postgres [.] AllocSetAlloc
+ 2.68% postgres postgres [.] _bt_compare
+ 2.36% postgres postgres [.] LWLockAcquire
+ 2.13% postgres postgres [.] PostgresMain
+ 1.47% postgres postgres [.] LWLockRelease
+ 1.32% postgres libc-2.25.so [.] _int_malloc
+ 1.23% postgres libc-2.25.so [.] vfprintf
+ 1.22% postgres postgres [.] LockAcquire
+ 1.20% postgres postgres [.] _bt_first
- 1.11% postgres libc-2.25.so [.] strlen
- strlen
+ 32.24% MemoryContextCreate
+ 16.97% pq_getmsgstring
+ 14.63% set_ps_display

So I'd expect it to help a small amount.

- Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-12-11 19:50:59 Re: Rethinking MemoryContext creation
Previous Message Tom Lane 2017-12-11 18:09:42 Re: Rethinking MemoryContext creation