From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: David Steele <david@pgmasters.net>
Cc: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: David Fetter <david@fetter.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Oleg Bartunov <obartunov@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Date: Wed, 2 Dec 2020 20:18:08 +0100
Message-ID: <20201202191808.kdnwzgc5kattfro3@localhost> (raw)
In-Reply-To: <1651995.1606931931@sss.pgh.pa.us>
References: <CAFj8pRCUSjBAzdfe3meEk9OMY-ZaQRmTgsaJwGRDQ+jh=0x5gA@mail.gmail.com>
<20200920154652.etzmrphoe3hiod7t@localhost>
<CAFj8pRCAeJABdnU68orQ_SetFPiV7kvFgLAyU2ZF8d2n3RFXSA@mail.gmail.com>
<20200928093631.obnmgllx3ihhjvsd@localhost>
<CAPpHfdsP4xtDZfm2Ouat6vqf1U6gKMHiyW6gk6FPj35QDSq5kg@mail.gmail.com>
<20201130113454.ohb6oho4fvwtpz3t@localhost>
<CAPpHfdtenYX+JKoDnuZQDJTc3Hx_2SK=vqYkpNUFfLL7j9c9QQ@mail.gmail.com>
<20201130132619.zzgl272m5rcnhvzt@localhost>
<20201202145958.mkkxqmn7jeik6yem@localhost>
<1651995.1606931931@sss.pgh.pa.us>
> 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:
>
> --- cut ---
> create or replace function arraytest(n int) returns void as
> $$
> declare
> a int[];
> begin
> a := array[1, 1];
> for i in 3..n loop
> a[i] := a[i-1] - a[i-2];
> end loop;
> end;
> $$
> language plpgsql stable;
>
> \timing on
>
> select arraytest(10000000);
> --- cut ---
>
> 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'm also not quite sure where the cost is going. It looks like
> 0001+0002 aren't doing much to the executor except introducing
> one level of subroutine call, which doesn't seem like it'd account
> for that.
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? At the same time, I remember had conducted this sort of tests
before when you and others raised the performance degradation question
and the main part of the patch was already more or less stable. From
what I remember the numbers back then were also rather small.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: 9erthalion6@gmail.com, tgl@sss.pgh.pa.us, aekorotkov@gmail.com, pavel.stehule@gmail.com, pryzby@telsasoft.com, david@pgmasters.net, n.gluhov@postgrespro.ru, alvherre@2ndquadrant.com, david@fetter.org, thomas.munro@gmail.com, oleksandr.shulgin@zalando.de, robertmhaas@gmail.com, andres@anarazel.de, michael.paquier@gmail.com, obartunov@gmail.com, peter.eisentraut@2ndquadrant.com
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
In-Reply-To: <20201202191808.kdnwzgc5kattfro3@localhost>
References: <CAFj8pRCUSjBAzdfe3meEk9OMY-ZaQRmTgsaJwGRDQ+jh=0x5gA@mail.gmail.com> <20200920154652.etzmrphoe3hiod7t@localhost> <CAFj8pRCAeJABdnU68orQ_SetFPiV7kvFgLAyU2ZF8d2n3RFXSA@mail.gmail.com> <20200928093631.obnmgllx3ihhjvsd@localhost> <CAPpHfdsP4xtDZfm2Ouat6vqf1U6gKMHiyW6gk6FPj35QDSq5kg@mail.gmail.com> <20201130113454.ohb6oho4fvwtpz3t@localhost> <CAPpHfdtenYX+JKoDnuZQDJTc3Hx_2SK=vqYkpNUFfLL7j9c9QQ@mail.gmail.com> <20201130132619.zzgl272m5rcnhvzt@localhost> <20201202145958.mkkxqmn7jeik6yem@localhost> <1651995.1606931931@sss.pgh.pa.us> <20201202191808.kdnwzgc5kattfro3@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox