Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a hash table to store index entries #3074

Closed
carlosmn opened this issue Apr 25, 2015 · 1 comment
Closed

Use a hash table to store index entries #3074

carlosmn opened this issue Apr 25, 2015 · 1 comment

Comments

@carlosmn
Copy link
Member

We currently have a vector as the data backing for the index' entries. This makes looking up an entry O(n) over the amount of entries, which can grow large. Using a hash table would allow us to do this in amortized O(1) time.

We would still need to have a sorted vector of entries for some operations, but we may be able to get away with generating that one on the fly rather than update it on each operation. There is a PR #1169 which did this for an older version of the structure, so we can't take it as-is.

We have a data structure git_sortedcache which is currently used by the refdb code but was made so we could use it for the index as well. We should rewrite that PR with the sorted cache as backing store.

@Therzok
Copy link
Member

Therzok commented Apr 25, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants