diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-03-04 11:49:03 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-04 10:19:39 -0800 |
| commit | 2d71a1d4a23a42ac7dfc927d7263b8eef03fee2f (patch) | |
| tree | ca90247d532620b41877997a4c38742ea5cdc630 /reftable/iter.h | |
| parent | bb2d6be4c1010af3f92a7f4a6feaab957e0e906b (diff) | |
| download | git-2d71a1d4a23a42ac7dfc927d7263b8eef03fee2f.tar.gz | |
reftable/merged: remove unnecessary null check for subiters
Whenever we advance a subiter we first call `iterator_is_null()`. This
is not needed though because we only ever advance subiters which have
entries in the priority queue, and we do not end entries to the priority
queue when the subiter has been exhausted.
Drop the check as well as the now-unused function. This results in a
surprisingly big speedup:
Benchmark 1: show-ref: single matching ref (revision = HEAD~)
Time (mean ± σ): 138.1 ms ± 4.4 ms [User: 135.1 ms, System: 2.8 ms]
Range (min … max): 133.4 ms … 167.3 ms 1000 runs
Benchmark 2: show-ref: single matching ref (revision = HEAD)
Time (mean ± σ): 134.4 ms ± 4.2 ms [User: 131.5 ms, System: 2.8 ms]
Range (min … max): 130.0 ms … 164.0 ms 1000 runs
Summary
show-ref: single matching ref (revision = HEAD) ran
1.03 ± 0.05 times faster than show-ref: single matching ref (revision = HEAD~)
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/iter.h')
| -rw-r--r-- | reftable/iter.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/reftable/iter.h b/reftable/iter.h index 47d67d84df..537431baba 100644 --- a/reftable/iter.h +++ b/reftable/iter.h @@ -16,10 +16,6 @@ https://developers.google.com/open-source/licenses/bsd #include "reftable-iterator.h" #include "reftable-generic.h" -/* Returns true for a zeroed out iterator, such as the one returned from - * iterator_destroy. */ -int iterator_is_null(struct reftable_iterator *it); - /* iterator that produces only ref records that point to `oid` */ struct filtering_ref_iterator { int double_check; |
