Re: Boundary value check in lazy_tid_reaped() - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Boundary value check in lazy_tid_reaped()
Date
Msg-id CAH2-Wz=eWfq6qTtWd5j1QtyLL2AWYtF9_bJa61xE5wWHnZOsjQ@mail.gmail.com
Whole thread Raw
In response to Re: Boundary value check in lazy_tid_reaped()  (Masahiko Sawada <masahiko.sawada@2ndquadrant.com>)
List pgsql-hackers
On Tue, Sep 8, 2020 at 1:23 AM Masahiko Sawada
<masahiko.sawada@2ndquadrant.com> wrote:
> > > I wonder if you would also see a speed-up with a bsearch() replacement
> > > that is inlineable, so it can inline the comparator (instead of
> > > calling it through a function pointer).  I wonder if something more
> > > like (lblk << 32 | loff) - (rblk << 32 | roff) would go faster than
> > > the branchy comparator.
> >
> > Erm, off course that expression won't work... should be << 16, but
> > even then it would only work with a bsearch that uses int64_t
> > comparators, so I take that part back.
>
> Yeah, it seems to worth benchmarking the speed-up with an inlining.
> I'll do some performance tests with/without inlining on top of
> checking boundary values.

It sounds like Thomas was talking about something like
itemptr_encode() + itemptr_decode(). In case you didn't know, we
actually do something like this for the TID tuplesort used for CREATE
INDEX CONCURRENTLY.


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Collation versioning
Next
From: Justin Pryzby
Date:
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)