Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

plumbing: idxfile, avoid unnecessary building of reverse offset/hash map #1119

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

filipnavara
Copy link
Contributor

@filipnavara filipnavara commented Apr 20, 2019

The reverse offset/hash map was always built because of the following code path:

  • ObjectStorage.getFromPackfile is called to lookup object by hash
  • ObjectStorage.decodeObjectAt calls Packfile.GetByOffset (and also FindHash, to be addressed separately)
  • Packfile.GetByOffset calls FindHash

Thus for every lookup in pack file the reverse offset/hash map was always built. Keeping it up to date with forward lookups avoids building the full map until an offset delta object is hit.

Signed-off-by: Filip Navara <navara@emclient.com>
@mcuadros mcuadros merged commit 78092a2 into src-d:master Apr 22, 2019
@filipnavara filipnavara deleted the idxfile-reverse-index branch April 22, 2019 11:39
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants