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

Improvement/memory consumption new packfile parser #916

Conversation

jfontan
Copy link
Contributor

@jfontan jfontan commented Aug 14, 2018

  • plumbing: add buffer cache and use it in packfile parser: It uses less memory and is faster as slices don't have to be converted from/to MemoryObject and they are indexed by offset.

  • plumbing/pacfile: tidy up objectInfo struct

    • a new hasher is created when needed
    • delete unused fields
    • base content is no longer kept in memory

Testing clone of a local repo with a 1.1 Gb packfile and 3 million objects:

Before:

295.85user 19.33system 3:57.77elapsed 132%CPU (0avgtext+0avgdata 7045108maxresident)k
7312inputs+3482616outputs (0major+1836239minor)pagefaults 0swaps

Now:

397.70user 19.12system 4:48.93elapsed 144%CPU (0avgtext+0avgdata 2460856maxresident)k
0inputs+3482616outputs (0major+650858minor)pagefaults 0swaps

It uses less memory and is faster as slices don't have to be converted
from/to MemoryObject and they are indexed by offset.

Signed-off-by: Javi Fontan <[email protected]>
* a new hasher is created when needed
* delete unused fields
* base content is no longer kept in memory

Signed-off-by: Javi Fontan <[email protected]>
Copy link
Contributor

@erizocosmico erizocosmico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jfontan
Copy link
Contributor Author

jfontan commented Aug 14, 2018

Improved a bit the performance skipping deltas that already had the hash computed. This happens when the delta is used again as base but is not in cache.

Now:

346.68user 18.48system 4:05.61elapsed 148%CPU (0avgtext+0avgdata 2664700maxresident)k
0inputs+3486544outputs (0major+913970minor)pagefaults 0swaps

@jfontan jfontan changed the title [WIP] Improvement/memory consumption new packfile parser Improvement/memory consumption new packfile parser Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants