Re: Inlining of couple of functions in pl_exec.c improves performance - Mailing list pgsql-hackers

From Amit Khandekar
Subject Re: Inlining of couple of functions in pl_exec.c improves performance
Date
Msg-id CAJ3gD9cgeKzvxFEXOMgDYoac4h9hbjQ=ZiHtnZSTyg8WVtWcjg@mail.gmail.com
Whole thread Raw
In response to Re: Inlining of couple of functions in pl_exec.c improves performance  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Inlining of couple of functions in pl_exec.c improves performance
List pgsql-hackers
On Thu, 28 May 2020 at 14:39, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> I don't see 17% anywhere, but 3-5% is not bad.
Did you see 3-5% only for the pi function, or did you see the same
improvement also for the functions that I wrote ? I was getting a
consistent result of 14-18 % on both of the VMs. Also, is your test
machine running on Windows ? All the machines I tested were on Linux
kernel (Ubuntu)

Below are my results for your pi_est_1() function. For this function,
I am consistently getting 5-9 % improvement. I tested on 3 machines :

gcc : 8.4.0. -O2 option
OS : Ubuntu Bionic

explain analyze select pi_est_1(10000000)

1. x86_64 laptop VM (Intel Core i7-8665U)
HEAD :    2666 2617 2600 2630
Patched : 2502 2409 2460 2444


2. x86_64 VM (Xeon Gold 6151)
HEAD :    1664 1662 1721 1660
Patched : 1541 1548 1537 1526

3. ARM64 VM (Kunpeng)
HEAD :    2873 2864 2860 2861
Patched : 2568 2513 2501 2538


>
> patch 0001 has sense and can help with code structure
> patch 0002 it is little bit against simplicity, but for PLpgSQL with blocks structure it is correct.

Here, I moved the exec_stmt code into exec_stmts() function because
exec_stmts() was the only caller, and that function is not that big. I
am assuming you were referring to this point when you said it is a bit
against simplicity. But I didn't get what you implied by "but for
PLpgSQL with blocks structure it is correct"

-- 
Thanks,
-Amit Khandekar
Huawei Technologies



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: feature idea: use index when checking for NULLs before SET NOTNULL
Next
From: Pavel Stehule
Date:
Subject: Re: Inlining of couple of functions in pl_exec.c improves performance