ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib
Yuya Nishihara c82a62cf99 repo: turn IdIndex into sorted Vec, use binary search
Since IdIndex is immutable, we don't need fast insertion provided by BTreeMap.
Let's simply use Vec for some speed up. More importantly, this allows us to
store multiple (ChangeId, CommitId) pairs for the same change id, and will
unblock the use of IdIndex in revset::resolve_symbol().

Some benchmark numbers (against my "linux" repo) follow.

Command:
    hyperfine --warmup 3 "jj log -r master \
      -T 'commit_id.short_prefix_and_brackets()' \
      --no-commit-working-copy --no-graph"

Original:
    Time (mean ± σ):      1.892 s ±  0.031 s    [User: 1.800 s, System: 0.092 s]
    Range (min … max):    1.833 s …  1.935 s    10 runs

This commit:
    Time (mean ± σ):     867.5 ms ±   2.7 ms    [User: 809.9 ms, System: 57.7 ms]
    Range (min … max):   862.3 ms … 871.0 ms    10 runs
2023-01-23 07:38:04 +09:00
..
gen-protos cargo: bump prost-build from 0.11.5 to 0.11.6 2023-01-13 21:24:02 +00:00
src repo: turn IdIndex into sorted Vec, use binary search 2023-01-23 07:38:04 +09:00
tests op_heads_store: remove LockedOpHeads 2023-01-20 15:18:08 -08:00
testutils cargo: bump git2 from 0.16.0 to 0.16.1 2023-01-21 00:05:57 +00:00
build.rs lib: replace protobuf crate with prost 2022-12-22 07:04:35 -08:00
Cargo.toml cargo: bump git2 from 0.16.0 to 0.16.1 2023-01-21 00:05:57 +00:00