public inbox for [email protected]  
help / color / mirror / Atom feed
From: Xuneng Zhou <[email protected]>
To: Nazir Bilal Yavuz <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Streamify more code paths
Date: Thu, 12 Mar 2026 11:27:10 +0800
Message-ID: <CABPTF7Vjor4HhGZrgyTQ-+_ZC4Cu7V_4NOKf1T-f42q_oWxbag@mail.gmail.com> (raw)
In-Reply-To: <CAN55FZ3u_PSXX26pXJi8mo1-ykezV1L=GuFhfrGq73TCASeuyA@mail.gmail.com>
References: <CAN55FZ02eR083kPV_8_boWEJphXZW=-hRxJKp7nwR-WomyKb6g@mail.gmail.com>
	<CABPTF7VSa5L=k6ONVUZHfRrO2Y2_iYz6npWj0Na69RoCvSevpQ@mail.gmail.com>
	<CABPTF7V3+QGC+0W9ERCcAY14jq_w_XvmwrRs9vXbi_oqv4FnTQ@mail.gmail.com>
	<CABPTF7VyePb8O-WDgs2hCCXYhZzGzdjg0N3NkxojZ=ke4SB3pA@mail.gmail.com>
	<CAN55FZ39HSsXKTSi66ASq+i4Ed5FuGXD11hmJ+8c0F0O0+ozew@mail.gmail.com>
	<CABPTF7Vd4JWSHi9N7pGTzn6xmOdtAToCe1NGbZAH8U9_mXOqpw@mail.gmail.com>
	<CABPTF7W-f_zPN442FCp4Xaopi721oDmGYimq=VhAk=F7jwYZDQ@mail.gmail.com>
	<CABPTF7VUaRnvsXqa+628YkuR4oPVRr1mR2seXTkxabfiqQ3NHw@mail.gmail.com>
	<CABPTF7VtSYmC5LZSnkJWYn9PCkxgOJd9QbtAM79qftBK-fbA4w@mail.gmail.com>
	<CABPTF7UVCkub6jFXVk-qrYd4xjgiwRt1FTFL2=rBVV9SYcgfkQ@mail.gmail.com>
	<[email protected]>
	<CABPTF7XD51Qx2043p80npKmYEd67qMagK5AW=s6LNXyZt5s2nw@mail.gmail.com>
	<CAN55FZ3u_PSXX26pXJi8mo1-ykezV1L=GuFhfrGq73TCASeuyA@mail.gmail.com>

Hi,

On Wed, Mar 11, 2026 at 3:53 PM Nazir Bilal Yavuz <[email protected]> wrote:
>
> Hi,
>
> On Tue, 10 Mar 2026 at 16:23, Xuneng Zhou <[email protected]> wrote:
> >
> > Another code path that showed significant performance improvement is
> > pgstatindex [1]. I've incorporated the test into the script too. Here
> > are the results from my testing:
> >
> > method=worker io-workers=12
> > pgstatindex_large          base=   233.8ms  patch=    54.1ms   4.32x
> > ( 76.8%)  (reads=27460→1757, io_time=213.94→6.31ms)
> >
> > method=io_uring
> > pgstatindex_large          base=   224.2ms  patch=    56.4ms   3.98x
> > ( 74.9%)  (reads=27460→1757, io_time=204.41→4.88ms)
>
> I didn't run the benchmark yet but here is a small suggestion for the
> pgstatindex patch:
>
> +    p.current_blocknum = BTREE_METAPAGE + 1;
> +    p.last_exclusive = nblocks;
>
>      for (blkno = 1; blkno < nblocks; blkno++)
>
> ...
>
> +    p.current_blocknum = HASH_METAPAGE + 1;
> +    p.last_exclusive = nblocks;
>
>      for (blkno = 1; blkno < nblocks; blkno++)
>
> Could you move 'BTREE_METAPAGE + 1' and 'HASH_METAPAGE + 1' into
> variables and then set p.current_blocknum and blkno using those
> variables? p.current_blocknum and blkno should have the same initial
> values, this change makes code less error prone and easier to read in
> my opinion.
>
> Other than the comment above, LGTM.
>

Thanks! That makes sense to me. Please see the patch I’ll post later.

-- 
Best,
Xuneng





view thread (36+ 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]
  Subject: Re: Streamify more code paths
  In-Reply-To: <CABPTF7Vjor4HhGZrgyTQ-+_ZC4Cu7V_4NOKf1T-f42q_oWxbag@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