public inbox for [email protected]  
help / color / mirror / Atom feed
From: David Rowley <[email protected]>
To: Andres Freund <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Tomas Vondra <[email protected]>
Subject: Re: Avoid stack frame setup in performance critical routines using tail calls
Date: Tue, 20 Jul 2021 16:50:09 +1200
Message-ID: <CAApHDvpQQc67NbYJkM0GZWVw_wZvUvOuuANCPiOyobV=q1=owA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Tue, 20 Jul 2021 at 08:00, Andres Freund <[email protected]> wrote:
> I have *not* carefully benchmarked this, but a quick implementation of this
> does seem to increase readonly pgbench tps at a small scale by 2-3% (both

Interesting.

I've not taken the time to study the patch but I was running some
other benchmarks today on a small scale pgbench readonly test and I
took this patch for a spin to see if I could see the same performance
gains.

This is an AMD 3990x machine that seems to get the most throughput
from pgbench with 132 processes

I did: pgbench -T 240 -P 10 -c 132 -j 132 -S -M prepared
--random-seed=12345 postgres

master = dd498998a

Master: 3816959.53 tps
Patched: 3820723.252 tps

I didn't quite get the same 2-3% as you did, but it did come out
faster than on master.

David

	master	dense hash LockReleaseAll + aset tail call	aset tail call	dense hash LockReleaseAll
10	3758201.2	3741925.6	3737701.5	3713521.5
20	3810125.5	3861572.5	3830863.7	3844142.9
30	3806505.1	3851164.4	3832257.9	3848458
40	3816094.8	3855232.4	3832305.7	3855706.6
50	3820317.2	3846941	3829641.5	3851717.7
60	3827809	3849490.4	3812254.5	3851499.4
70	3828757.9	3844582.8	3829097.8	3849312
80	3824492.1	3843161.8	3821383	3852378.8
90	3816502.1	3851970.8	3825119.2	3854793.8
100	3819124.1	3839695.5	3839286.7	3860418.6
110	3816154.3	3851302.8	3821209.5	3845327.7
120	3817070.5	3852974.2	3833781	3845842.5
130	3815424.7	3854379.1	3830812.5	3847626
140	3823631.1	3852449.1	3825261.9	3846760.6
150	3820963.8	3837493.5	3820703.2	3840196.6
160	3827737	3837809.7	3835278.4	3841149.3
170	3827779.2	3851799.4	3818430.3	3840130.9
180	3829352	3853094	3823286.1	3842814.5
190	3825518.3	3854912.8	3816329.4	3841991
200	3823477.2	3838998.6	3816060.8	3839390.7
210	3809304.3	3845776.7	3814737.2	3836433.5
220	3814328.5	3841394.7	3818894	3842073.7
230	3811399.3	3839360.8	3811939	3843780.7
avg	3816959.53	3843368.809	3820723.252	3840672.478
		100.69%	100.10%	100.62%

Attachments:

  [text/plain] benchresults.txt (1.1K, ../CAApHDvpQQc67NbYJkM0GZWVw_wZvUvOuuANCPiOyobV=q1=owA@mail.gmail.com/2-benchresults.txt)
  download | inline:
	master	dense hash LockReleaseAll + aset tail call	aset tail call	dense hash LockReleaseAll
10	3758201.2	3741925.6	3737701.5	3713521.5
20	3810125.5	3861572.5	3830863.7	3844142.9
30	3806505.1	3851164.4	3832257.9	3848458
40	3816094.8	3855232.4	3832305.7	3855706.6
50	3820317.2	3846941	3829641.5	3851717.7
60	3827809	3849490.4	3812254.5	3851499.4
70	3828757.9	3844582.8	3829097.8	3849312
80	3824492.1	3843161.8	3821383	3852378.8
90	3816502.1	3851970.8	3825119.2	3854793.8
100	3819124.1	3839695.5	3839286.7	3860418.6
110	3816154.3	3851302.8	3821209.5	3845327.7
120	3817070.5	3852974.2	3833781	3845842.5
130	3815424.7	3854379.1	3830812.5	3847626
140	3823631.1	3852449.1	3825261.9	3846760.6
150	3820963.8	3837493.5	3820703.2	3840196.6
160	3827737	3837809.7	3835278.4	3841149.3
170	3827779.2	3851799.4	3818430.3	3840130.9
180	3829352	3853094	3823286.1	3842814.5
190	3825518.3	3854912.8	3816329.4	3841991
200	3823477.2	3838998.6	3816060.8	3839390.7
210	3809304.3	3845776.7	3814737.2	3836433.5
220	3814328.5	3841394.7	3818894	3842073.7
230	3811399.3	3839360.8	3811939	3843780.7
avg	3816959.53	3843368.809	3820723.252	3840672.478
		100.69%	100.10%	100.62%

view thread (7+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Avoid stack frame setup in performance critical routines using tail calls
  In-Reply-To: <CAApHDvpQQc67NbYJkM0GZWVw_wZvUvOuuANCPiOyobV=q1=owA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox