From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Justin Tobler <jltobler@gmail.com>
Subject: [PATCH v4 0/7] reftable: improvements for the `binsearch()` mechanism
Date: Wed, 3 Apr 2024 08:03:52 +0200 [thread overview]
Message-ID: <cover.1712123093.git.ps@pks.im> (raw)
In-Reply-To: <cover.1711109214.git.ps@pks.im>
[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]
Hi,
this is the fourth and hopefully final version of my patch series that
refactors the `binsearch()` mechanism in the reftable library.
There's only a single change compared to v3, which is a fix to a comment
that was misexplaining one of the cases when searching for the restart
points.
Thanks!
Patrick
Patrick Steinhardt (7):
reftable/basics: fix return type of `binsearch()` to be `size_t`
reftable/basics: improve `binsearch()` test
reftable/refname: refactor binary search over refnames
reftable/block: refactor binary search over restart points
reftable/block: fix error handling when searching restart points
reftable/record: extract function to decode key lengths
reftable/block: avoid decoding keys when searching restart points
reftable/basics.c | 7 ++-
reftable/basics.h | 7 +--
reftable/basics_test.c | 55 ++++++++++---------
reftable/block.c | 117 ++++++++++++++++++++++++++++++-----------
reftable/record.c | 34 ++++++++----
reftable/record.h | 6 +++
reftable/refname.c | 53 +++++++++----------
7 files changed, 182 insertions(+), 97 deletions(-)
Range-diff against v3:
1: baa07ef144 = 1: baa07ef144 reftable/basics: fix return type of `binsearch()` to be `size_t`
2: cbc2a107c1 = 2: cbc2a107c1 reftable/basics: improve `binsearch()` test
3: f5bf65e0dd = 3: f5bf65e0dd reftable/refname: refactor binary search over refnames
4: 435cd0be94 ! 4: 6d4a79f3e2 reftable/block: refactor binary search over restart points
@@ reftable/block.c: int block_reader_seek(struct block_reader *br, struct block_it
+ /*
+ * Now there are multiple cases:
+ *
-+ * - `i == 0`: The wanted record must be contained before the first
-+ * restart point. We will thus start searching for the record in
-+ * that section after accounting for the header offset.
++ * - `i == 0`: The wanted record is smaller than the record found at
++ * the first restart point. As the first restart point is the first
++ * record in the block, our wanted record cannot be located in this
++ * block at all. We still need to position the iterator so that the
++ * next call to `block_iter_next()` will yield an end-of-iterator
++ * signal.
+ *
+ * - `i == restart_count`: The wanted record was not found at any of
+ * the restart points. As there is no restart point at the end of
5: 8d8abfd290 = 5: 52c238ee9f reftable/block: fix error handling when searching restart points
6: f87f7ad01a = 6: ca41ad30f4 reftable/record: extract function to decode key lengths
7: f53bf9e1cc = 7: 632f725dde reftable/block: avoid decoding keys when searching restart points
--
2.44.GIT
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-04-03 6:03 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 12:22 [PATCH 0/7] reftable: improvements for the `binsearch()` mechanism Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 1/7] reftable/basics: fix return type of `binsearch()` to be `size_t` Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 2/7] reftable/basics: improve `binsearch()` test Patrick Steinhardt
2024-03-22 18:46 ` Justin Tobler
2024-03-25 10:07 ` Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 3/7] reftable/refname: refactor binary search over refnames Patrick Steinhardt
2024-03-22 18:55 ` Justin Tobler
2024-03-25 10:07 ` Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 4/7] reftable/block: refactor binary search over restart points Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 5/7] reftable/block: fix error handling when searching " Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 6/7] reftable/record: extract function to decode key lengths Patrick Steinhardt
2024-03-22 12:22 ` [PATCH 7/7] reftable/block: avoid decoding keys when searching restart points Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 0/7] reftable: improvements for the `binsearch()` mechanism Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 1/7] reftable/basics: fix return type of `binsearch()` to be `size_t` Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 2/7] reftable/basics: improve `binsearch()` test Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 3/7] reftable/refname: refactor binary search over refnames Patrick Steinhardt
2024-04-02 16:27 ` Justin Tobler
2024-04-02 17:15 ` Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 4/7] reftable/block: refactor binary search over restart points Patrick Steinhardt
2024-04-02 16:42 ` Justin Tobler
2024-04-02 17:15 ` Patrick Steinhardt
2024-04-02 17:46 ` Justin Tobler
2024-04-03 6:01 ` Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 5/7] reftable/block: fix error handling when searching " Patrick Steinhardt
2024-03-25 10:10 ` [PATCH v2 6/7] reftable/record: extract function to decode key lengths Patrick Steinhardt
2024-03-25 10:11 ` [PATCH v2 7/7] reftable/block: avoid decoding keys when searching restart points Patrick Steinhardt
2024-04-02 16:47 ` Justin Tobler
2024-04-02 17:15 ` Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 0/7] reftable: improvements for the `binsearch()` mechanism Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 1/7] reftable/basics: fix return type of `binsearch()` to be `size_t` Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 2/7] reftable/basics: improve `binsearch()` test Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 3/7] reftable/refname: refactor binary search over refnames Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 4/7] reftable/block: refactor binary search over restart points Patrick Steinhardt
2024-04-02 17:24 ` [PATCH v3 5/7] reftable/block: fix error handling when searching " Patrick Steinhardt
2024-04-02 17:25 ` [PATCH v3 6/7] reftable/record: extract function to decode key lengths Patrick Steinhardt
2024-04-02 17:25 ` [PATCH v3 7/7] reftable/block: avoid decoding keys when searching restart points Patrick Steinhardt
2024-04-02 17:49 ` [PATCH v3 0/7] reftable: improvements for the `binsearch()` mechanism Justin Tobler
2024-04-03 6:03 ` Patrick Steinhardt [this message]
2024-04-03 6:03 ` [PATCH v4 1/7] reftable/basics: fix return type of `binsearch()` to be `size_t` Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 2/7] reftable/basics: improve `binsearch()` test Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 3/7] reftable/refname: refactor binary search over refnames Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 4/7] reftable/block: refactor binary search over restart points Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 5/7] reftable/block: fix error handling when searching " Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 6/7] reftable/record: extract function to decode key lengths Patrick Steinhardt
2024-04-03 6:04 ` [PATCH v4 7/7] reftable/block: avoid decoding keys when searching restart points Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1712123093.git.ps@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).