-
Notifications
You must be signed in to change notification settings - Fork 534
Improve Index decoder implementation #893
Comments
So, right now I have a more or less working implementation of the index that does the same as JGit's. With the new way of doing things, and the new overall design as specified in the design document, it does not make much sense to make As I assume, the writing of idxfiles will be done by the Packfile parser with a different encoder for that usecase. This will leave the repo in a sort of broken state, since there is no real replacement for that functionality working right now, etc. Should we do a shared branch for working on that design document until all the pieces work together? Otherwise, PR this changes will leave everything partly broken. WDYT? @ajnavarro @jfontan |
Decoding a packfile index now:
Decoding a packfile index before:
After this changes decoding is slower and uses way more memory. UPDATE: after a few tweaks the speed is almost the same:
UPDATE 2: now it's slightly faster (by a few ns). I did a version with a more compact memory usage (even though it's still bigger)
|
@erizocosmico I think it's a good idea having this branch for development. I can PR to it as soon as I have my part working. Also it's weird that reading this way is slower. Is it just reading the index in memory? |
Now it's faster. The only thing I did to reduce the speed was allocating less memory, so I guess it was because it spent a lot of time allocating. |
@ajnavarro Packfile decoder used to get hashes by offset using the |
@erizocosmico added that functionality on #927 can we close this issue now? |
Yup |
Uh oh!
There was an error while loading. Please reload this page.
As described in https://docs.google.com/document/d/1I2Vte4LhMdpx0kvlrg-k6hNA-0kUGtUkC1-kfwbCmeI
Index will be an interface with the following methods:
First Index implementation will be MemoryIndex and it must be just a readFull from the filesystem and load into memory as it is. JGit is doing this. Just as byte arrays.
Entries() method can be used to iterate over packfile objects. A good use case for it is per example to get all the commits into the packfile. We can seek over object headers without the need to read again all the file content (something that we are doing right now).
Index must be loaded in a lazy way.
The text was updated successfully, but these errors were encountered: