Re: Rethinking MemoryContext creation - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Rethinking MemoryContext creation
Date
Msg-id 20171211181714.ddfgdnwm6kwusyq6@alap3.anarazel.de
Whole thread Raw
In response to Re: Rethinking MemoryContext creation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2017-12-11 13:09:42 -0500, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> > On 12/10/2017 04:42 PM, Tom Lane wrote:
> >> Peter Geoghegan <pg@bowt.ie> writes:
> >>> On Sat, Dec 9, 2017 at 5:53 PM, Tom Lane <tgl@sss.pgh.pa.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rethinking MemoryContext creation
Next
From: Tom Lane
Date:
Subject: Re: Rethinking MemoryContext creation