On Wed, Aug 5, 2026 at 9:02 AM Heikki Linnakangas <[email protected]> wrote:

> Can you share the benchmark you used, please?


Please see the attached lock_hold_benchmark.diff file; the bench_collide.sh
and compare_collide.sh scripts are utilized to measure the average time
under the spinlock.

Is that a problem or not? Can you come up with an adversary test case where
> those conflicts cause a lot of spinning?


I do not believe it is a problem. Since the change is in
InvalidateBuffer(), the extra spinning can only occur during DROP/TRUNCATE
operations, which should in turn execute while holding the appropriate
AccessExclusiveLock for the affected relation(s). As such, the worst case
is most likely just clock-sweep and bgwriter collisions during a large
DROP/TRUNCATE, which should not result in much contention and additional
spinning.

On Thu, Aug 6, 2026 at 2:07 AM Andrey Borodin <[email protected]> wrote:

> Perhaps, simple-update worth deeper investigation.
>

 I attempted to replicate your setup (16 vCPU’s, scale-100 / 128 MB, six
paired 30-second runs) and run the same workloads, though I am unable to
reproduce those exact numbers:

*Clients*       *Patched/Base TPS Delta (%)*
16              +1.60%
64              +1.01%
256            +1.13%

I assume that these numbers have some variance, so I ran the same setup
with a slightly higher sample size (thirty paired 20-second runs instead,
bracketed pairs indicate a 95% bootstrap confidence interval):

*Workload*                    *1*
*16*                                       *64*
             *256 Clients*
select-only                +0.38% [-0.12, +0.66]       +0.56% [+0.35,
+1.40]       +0.13% [-0.13, +0.28]          +0.70% [+0.12, +1.42]
simple-update           +0.30% [-0.68, +0.80]       +0.30% [-0.75, +1.25]
      -0.16% [-0.41, +0.23]          +0.19% [-1.19, +1.91]
TPC-B-like                +0.65% [+0.07, +1.45]      +0.46% [-3.44, +5.30]
      +0.29% [-0.28, +0.66]          +0.18% [-1.03, +1.47]

In all given cases, there appears to be no statistically significant TPS
difference between dynahash and the restructured table in the patch at
worst, with the restructured table looking to be slightly better in the
best scenario(s).

Best,
Dhruv Aron

Attachment: lock_hold_benchmark.diff
Description: Binary data

Reply via email to