git/refs
Patrick Steinhardt 43f70eaea0 refs/reftable: precompute prefix length
We're recomputing the prefix length on every iteration of the ref
iterator. Precompute it for another speedup when iterating over 1
million refs:

    Benchmark 1: show-ref: single matching ref (revision = HEAD~)
      Time (mean ± σ):     100.3 ms ±   3.7 ms    [User: 97.3 ms, System: 2.8 ms]
      Range (min … max):    97.5 ms … 139.7 ms    1000 runs

    Benchmark 2: show-ref: single matching ref (revision = HEAD)
      Time (mean ± σ):      95.8 ms ±   3.4 ms    [User: 92.9 ms, System: 2.8 ms]
      Range (min … max):    93.0 ms … 121.9 ms    1000 runs

    Summary
      show-ref: single matching ref (revision = HEAD) ran
        1.05 ± 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>
2024-03-04 10:19:58 -08:00
..
debug.c refs: prepare `refs_init_db()` for initializing worktree refs 2024-01-08 13:17:30 -08:00
files-backend.c Merge branch 'ps/worktree-refdb-initialization' 2024-01-26 08:54:46 -08:00
iterator.c treewide: remove unnecessary cache.h inclusion from several sources 2023-03-21 10:56:51 -07:00
packed-backend.c Merge branch 'ps/worktree-refdb-initialization' 2024-01-26 08:54:46 -08:00
packed-backend.h Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'" 2022-04-13 15:51:33 -07:00
ref-cache.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
ref-cache.h hash-ll.h: split out of hash.h to remove dependency on repository.h 2023-04-24 12:47:32 -07:00
refs-internal.h refs: introduce reftable backend 2024-02-07 08:28:37 -08:00
reftable-backend.c refs/reftable: precompute prefix length 2024-03-04 10:19:58 -08:00