[RFC/PATCH 0/2] Speed up fetch with large number of tags
- From
Julian Phillips <julian@quantumfyre.co.uk>
- Date
- Sep 16, 2009, 07:53 UTC
- Message-ID
- <20090916074737.58044.42776.julian@quantumfyre.co.uk>
I have a repository at $dayjob where fetch was taking ~30s to tell me that there were no updates.
It turns out that I appear to have added a nasty linear search of all remote refs for every commit (i.e. tag^{}) tag ref way back in the original C implementation of fetch. This doesn't scale well to large numbers of refs, so this replaces it with a hash table based lookup instead, which brings the time down to a few seconds even for very large ref counts.
I haven't tested it with non-native transports, but there is no reason to believe that the code should be transport specific.
Julian Phillips (2): ref-dict: Add a set of functions for working with a ref dictionary fetch: Speed up fetch by using ref dictionary
Makefile | 1 + builtin-fetch.c | 19 ++++++------- ref-dict.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ref-dict.h | 13 +++++++++ 4 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 ref-dict.c create mode 100644 ref-dict.h