ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib
Ilya Grigoriev 606eefa8c4 A BTree-based index of commit & change ids to optimize unique_prefix
This is fast enough to be used on medium-sized repositories such as git/git.
It is a bit slow, but bearable, on huge repositories such as torvalds/linux.

There is 0 performance penalty if the display of unique prefixes is disabled

A trie-based implementation will be submitted for consideration in a
follow-up PR. It is faster, but more complicated.

**Update:** I also just discovered https://sapling-scm.com/docs/internals/indexedlog/

There are three important aspects of performance that seemed relevant:

1. Speed of computing the shortest unique prefix per id. It is worlds faster
  than the naive implementation before this commit. It can be optimized
  furher by using a trie or maybe the `fst` crate.

2. Speed of inital loading of the index that happens before the first commit is
  shown. This is the part that's noticeable but bearable on torvalds/linux. 
  
  This could be optimized by storing a sorted list of commit and change ids on
  disk.  This would likely involve reworking the `Index`.

  Failing that, the speed of inital loading doesn't change if a trie is used
  and would likely be worse with the `fst` crate

3. Memory use is unremarkable here. I don't have good tools to measure it
  precisely, but it does not balloon to gigabytes even on the linux repo.
2023-01-17 22:01:09 -08:00
..
gen-protos cargo: bump prost-build from 0.11.5 to 0.11.6 2023-01-13 21:24:02 +00:00
src A BTree-based index of commit & change ids to optimize unique_prefix 2023-01-17 22:01:09 -08:00
tests let branches and remote_branches revset functions take needles as arguments 2023-01-16 12:15:30 +05:30
testutils Fix random seed in all tests that use testutils::user_settings 2023-01-15 10:15:44 -08:00
build.rs lib: replace protobuf crate with prost 2022-12-22 07:04:35 -08:00
Cargo.toml cargo: drop dependency on "uuid" 2023-01-14 23:48:02 +09:00