Re: [HACKERS] [PATCH] Generic type subscripting

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, David Steele <david(at)pgmasters(dot)net>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Date: 2020-12-03 05:19:50
Message-ID: CAFj8pRC3LNDN8KJoZqWg6o+sv9_MzeL1cLycLuQaen_HEW_V6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 2. 12. 2020 v 21:02 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Dmitry Dolgov <9erthalion6(at)gmail(dot)com> writes:
> >> On Wed, Dec 02, 2020 at 12:58:51PM -0500, Tom Lane wrote:
> >> So ... one of the things that's been worrying me about this patch
> >> from day one is whether it would create a noticeable performance
> >> penalty for existing use-cases. I did a small amount of experimentation
> >> about that with the v35 patchset, and it didn't take long at all to
> >> find that this:
> >> ...
> >> is about 15% slower with the patch than with HEAD. I'm not sure
> >> what an acceptable penalty might be, but 15% is certainly not it.
>
> > I've tried to reproduce that, but get ~2-4% slowdown (with a pinned
> > backend, no turbo etc). Are there any special steps I've probably
> > missed?
>
> Hmm, no, I just built with --disable-cassert and otherwise my usual
> development options.
>
> I had experimented with some other variants of the test case,
> where the repeated statement is
>
> a[i] := i; -- about the same
> a[i] := a[i-1] + 1; -- 7% slower
> a[i] := a[i-1] - a[i-2]; -- 15% slower
>
> so it seems clear that the penalty is on the array fetch not array
> assign side. This isn't too surprising now that I think about it,
> because plpgsql's array assignment code is untouched by the patch
> (which is a large feature omission BTW: you still can't write
> jsonb['x'] := y;
>

The refactoring of the left part of the assignment statement in plpgsql
probably can be harder work than this patch. But it should be the next
step.

in plpgsql).
>
>
I tested the last patch on my FC33 Lenovo T520 (I7) and I don't see 15%
slowdown too .. On my comp there is a slowdown of about 1.5-3%. I used your
function arraytest.

Regards

Pavel

> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-12-03 05:28:57 Re: Huge memory consumption on partitioned table with FKs
Previous Message Joel Mariadasan (jomariad) 2020-12-03 05:05:49 pg_ctl.exe file deleted automatically