diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-04-08 14:24:01 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-08 16:59:02 -0700 |
| commit | 4af31dc84a1d63c0c78cb004421405aa5a4f1f80 (patch) | |
| tree | ac711a20b55e66961764f1052040661ba6598ab0 /reftable/error.c | |
| parent | 455d61b6d22b41176194483f82c9caa531661bec (diff) | |
| download | git-4af31dc84a1d63c0c78cb004421405aa5a4f1f80.tar.gz | |
refs/reftable: skip duplicate name checks
All the callback functions which write refs in the reftable backend
perform D/F conflict checks via `refs_verify_refname_available()`. But
in reality we perform these D/F conflict checks a second time in the
reftable library via `stack_check_addition()`.
Interestingly, the code in the reftable library is inferior compared to
the generic function:
- It is slower than `refs_verify_refname_available()`, even though
this can probably be optimized.
- It does not provide a proper error message to the caller, and thus
all the user would see is a generic "file/directory conflict"
message.
Disable the D/F conflict checks in the reftable library by setting the
`skip_name_check` write option. This results in a non-negligible speedup
when writing many refs. The following benchmark writes 100k refs in a
single transaction:
Benchmark 1: update-ref: create many refs (HEAD~)
Time (mean ± σ): 3.241 s ± 0.040 s [User: 1.854 s, System: 1.381 s]
Range (min … max): 3.185 s … 3.454 s 100 runs
Benchmark 2: update-ref: create many refs (HEAD)
Time (mean ± σ): 2.878 s ± 0.024 s [User: 1.506 s, System: 1.367 s]
Range (min … max): 2.838 s … 2.960 s 100 runs
Summary
update-ref: create many refs (HEAD~) ran
1.13 ± 0.02 times faster than update-ref: create many refs (HEAD)
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/error.c')
0 files changed, 0 insertions, 0 deletions
