Re: Moving _bt_readpage and _bt_checkkeys into a new .c file

Victor Yegorov <vyegorov@gmail.com>

From: Victor Yegorov <vyegorov@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-06T08:07:19Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid pointer chasing in _bt_readpage inner loop.

  2. Relocate _bt_readpage and related functions.

  3. Fix bug in nbtree array primitive scan scheduling.

сб, 6 дек. 2025 г. в 06:49, Peter Geoghegan <pg@bowt.ie>:

> Attached patch v1-0001-* moves _bt_readpage (from nbtsearch.c) and
> _bt_checkkeys (from nbtutils.c) into a new .c file -- nbtreadpage.c.
> It also moves all of the functions that _bt_checkkeys itself calls
> (either directly or indirectly) over to nbtreadpage.c. This first
> patch is strictly mechanical, in that it only moves existing functions
> around, without directly changing anything.
>
> …
>
> This seems like an enhancement that is pretty easy to justify. Note
> that the changes in the second patch essentially restore things to how
> they already were prior to my commit 763d65ae. I doubt that that
> change caused a regression at the time, since the speedup that I see
> now depends on the changes in the first patch (though I must admit
> that I haven't benchmarked the changes made by the second patch in
> isolation).
>

Hey.

I like this change and I agree that it's both handy and gives an easy
performance boost.

Patch applies and compiles cleanly. I can barely see a performance boost on
my end (VM on a busy host), round 1%, but I still consider this change
beneficial.

-- 
Victor Yegorov