From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwenn@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/8] reftable: fixes and optimizations (pt.2)
Date: Thu, 28 Dec 2023 07:27:32 +0100 [thread overview]
Message-ID: <cover.1703743174.git.ps@pks.im> (raw)
In-Reply-To: <cover.1703063544.git.ps@pks.im>
[-- Attachment #1: Type: text/plain, Size: 3681 bytes --]
Hi,
this is the second version of my patch series that contains additional
fixes and optimizations for the reftable library. Changes compared to
v1:
- Added a patch to not auto-compact twice in `reftable_stack_add()`,
reported by Han-Wen.
- Fixed an issue I've previously introduced while rebasing the patch
series.
- Fixed a missing header, as reported by Junio.
Due to the added patch that avoids double auto-compaction this patch
series now depends on 637e34a783 (Merge branch 'ps/reftable-fixes',
2023-12-27).
Patrick
Patrick Steinhardt (8):
reftable/stack: do not overwrite errors when compacting
reftable/stack: do not auto-compact twice in `reftable_stack_add()`
reftable/writer: fix index corruption when writing multiple indices
reftable/record: constify some parts of the interface
reftable/record: store "val1" hashes as static arrays
reftable/record: store "val2" hashes as static arrays
reftable/merged: really reuse buffers to compute record keys
reftable/merged: transfer ownership of records when iterating
reftable/block_test.c | 4 +-
reftable/merged.c | 8 +--
reftable/merged_test.c | 16 +++---
reftable/readwrite_test.c | 102 +++++++++++++++++++++++++++++++------
reftable/record.c | 17 ++-----
reftable/record_test.c | 5 --
reftable/reftable-record.h | 11 ++--
reftable/stack.c | 23 +++------
reftable/stack_test.c | 2 -
reftable/writer.c | 4 +-
10 files changed, 117 insertions(+), 75 deletions(-)
Range-diff against v1:
1: 573fb2c4fb = 1: 22a57020c6 reftable/stack: do not overwrite errors when compacting
-: ---------- > 2: a08f7efc99 reftable/stack: do not auto-compact twice in `reftable_stack_add()`
2: 86ee79c48d = 3: c00e08d97f reftable/writer: fix index corruption when writing multiple indices
3: 3ad4a0e5b9 = 4: 3416268087 reftable/record: constify some parts of the interface
4: 06c9eab678 ! 5: 46ca3a37f8 reftable/record: store "val1" hashes as static arrays
@@ reftable/readwrite_test.c: static void test_write_object_id_length(void)
};
int err;
int i;
+@@ reftable/readwrite_test.c: static void test_write_multiple_indices(void)
+ writer = reftable_new_writer(&strbuf_add_void, &writer_buf, &opts);
+ reftable_writer_set_limits(writer, 1, 1);
+ for (i = 0; i < 100; i++) {
+- unsigned char hash[GIT_SHA1_RAWSZ] = {i};
+ struct reftable_ref_record ref = {
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+- .value.val1 = hash,
++ .value.val1 = {i},
+ };
+
+ strbuf_reset(&buf);
## reftable/record.c ##
@@ reftable/record.c: static void reftable_ref_record_copy_from(void *rec, const void *src_rec,
@@ reftable/record_test.c: static void test_reftable_ref_record_roundtrip(void)
case REFTABLE_REF_VAL2:
## reftable/reftable-record.h ##
+@@ reftable/reftable-record.h: license that can be found in the LICENSE file or at
+ #ifndef REFTABLE_RECORD_H
+ #define REFTABLE_RECORD_H
+
++#include "hash-ll.h"
+ #include <stdint.h>
+
+ /*
@@ reftable/reftable-record.h: struct reftable_ref_record {
#define REFTABLE_NR_REF_VALUETYPES 4
} value_type;
5: 49f13c123f = 6: c8a36917b1 reftable/record: store "val2" hashes as static arrays
6: 32b7ddee28 = 7: 6313f8affd reftable/merged: really reuse buffers to compute record keys
7: 3dbabea22a = 8: 25a3919e58 reftable/merged: transfer ownership of records when iterating
--
2.43.GIT
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-12-28 6:27 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 9:17 [PATCH 0/7] reftable: fixes and optimizations (pt.2) Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 1/7] reftable/stack: do not overwrite errors when compacting Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 2/7] reftable/writer: fix index corruption when writing multiple indices Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 3/7] reftable/record: constify some parts of the interface Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 4/7] reftable/record: store "val1" hashes as static arrays Patrick Steinhardt
2023-12-20 9:25 ` Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 5/7] reftable/record: store "val2" " Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 6/7] reftable/merged: really reuse buffers to compute record keys Patrick Steinhardt
2023-12-20 9:17 ` [PATCH 7/7] reftable/merged: transfer ownership of records when iterating Patrick Steinhardt
2023-12-20 19:10 ` [PATCH 0/7] reftable: fixes and optimizations (pt.2) Junio C Hamano
2023-12-28 6:27 ` Patrick Steinhardt [this message]
2023-12-28 6:27 ` [PATCH v2 1/8] reftable/stack: do not overwrite errors when compacting Patrick Steinhardt
2023-12-28 6:27 ` [PATCH v2 2/8] reftable/stack: do not auto-compact twice in `reftable_stack_add()` Patrick Steinhardt
2023-12-28 6:27 ` [PATCH v2 3/8] reftable/writer: fix index corruption when writing multiple indices Patrick Steinhardt
2023-12-28 6:27 ` [PATCH v2 4/8] reftable/record: constify some parts of the interface Patrick Steinhardt
2023-12-28 6:27 ` [PATCH v2 5/8] reftable/record: store "val1" hashes as static arrays Patrick Steinhardt
2023-12-28 17:03 ` Junio C Hamano
2023-12-28 6:28 ` [PATCH v2 6/8] reftable/record: store "val2" " Patrick Steinhardt
2023-12-28 6:28 ` [PATCH v2 7/8] reftable/merged: really reuse buffers to compute record keys Patrick Steinhardt
2023-12-28 17:03 ` Junio C Hamano
2023-12-28 6:28 ` [PATCH v2 8/8] reftable/merged: transfer ownership of records when iterating Patrick Steinhardt
2023-12-28 17:04 ` Junio C Hamano
2024-01-03 6:22 ` [PATCH v3 0/8] reftable: fixes and optimizations (pt.2) Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 1/8] reftable/stack: do not overwrite errors when compacting Patrick Steinhardt
2024-02-14 15:12 ` Han-Wen Nienhuys
2024-02-15 7:43 ` Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 2/8] reftable/stack: do not auto-compact twice in `reftable_stack_add()` Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 3/8] reftable/writer: fix index corruption when writing multiple indices Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 4/8] reftable/record: constify some parts of the interface Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 5/8] reftable/record: store "val1" hashes as static arrays Patrick Steinhardt
2024-02-05 11:39 ` Karthik Nayak
2024-02-06 6:03 ` Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 6/8] reftable/record: store "val2" " Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 7/8] reftable/merged: really reuse buffers to compute record keys Patrick Steinhardt
2024-01-03 6:22 ` [PATCH v3 8/8] reftable/merged: transfer ownership of records when iterating Patrick Steinhardt
2024-02-05 13:08 ` [PATCH v3 0/8] reftable: fixes and optimizations (pt.2) Karthik Nayak
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.1703743174.git.ps@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hanwenn@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).