diff options
author | Colin Stolley <ccstolley@github.com> | 2021-10-07 13:26:52 -0500 |
---|---|---|
committer | Colin Stolley <ccstolley@github.com> | 2021-12-14 10:07:03 -0600 |
commit | ad7a51d83496cb6f2bb7b08a426f832f589c7707 (patch) | |
tree | 3c967c1b268fc1fb9d5997f384ec1012837c59c6 /docs | |
parent | 12b53eb0318b0529514ad7e318de70b8325d43f2 (diff) | |
download | libgit2-ad7a51d83496cb6f2bb7b08a426f832f589c7707.tar.gz |
refs: Speed up packed lookups.
Currently ref lookups require loading the entire packed-refs file into
a hashmap in memory. For repos with large numbers of refs this can be
painfully slow.
This patch replaces the existing lookup code and instead mmap()'s the
packed-refs file and performs a binary search to locate the ref entry.
Git uses a similiar approach.
The old hash table codepath is still used for unsorted packed-refs files.
This patch also fixes a minor bug where the "peeled" trait is never
parsed correctly from the packed-refs header.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/changelog.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/changelog.md b/docs/changelog.md index 8060874df..3723a080c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1963,3 +1963,8 @@ v0.22 functions. This is not something which we can know to do. A last-resort convenience function is provided in sys/openssl.h, `git_openssl_set_locking()` which can be used to set the locking. + +* `git_reference_*()` functions use mmap() + binary search for packed + refs lookups when using the fs backend. Previously all entries were + read into a hashtable, which could be slow for repositories with a + large number of refs. |