diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-03-03 17:50:47 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-03-04 02:18:29 +0400 |
commit | 0e040c031edc6b61692e74a9b8ce0b0ff86d270a (patch) | |
tree | 4133f94021429088a726c210cacf9df010c74e6f /src/pack.h | |
parent | 29ab8774e53d1c053802b69f4e66283a23e7290a (diff) |
indexer: use a hashtable for keeping track of offsets
These offsets are needed for REF_DELTA objects, which encode which
object they use as a base, but not where it lies in the packfile, so
we need a list.
These objects are mostly from older packfiles, before OFS_DELTA was
widely spread. The time spent in indexing these packfiles is greatly
reduced, though remains above what git is able to do.
Diffstat (limited to 'src/pack.h')
-rw-r--r-- | src/pack.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pack.h b/src/pack.h index 6c43d8f5b..8d7e33dfe 100644 --- a/src/pack.h +++ b/src/pack.h @@ -16,6 +16,7 @@ #include "map.h" #include "mwindow.h" #include "odb.h" +#include "oidmap.h" #define GIT_PACK_FILE_MODE 0444 @@ -62,6 +63,7 @@ typedef struct git_pack_cache_entry { #include "offmap.h" GIT__USE_OFFMAP; +GIT__USE_OIDMAP; #define GIT_PACK_CACHE_MEMORY_LIMIT 16 * 1024 * 1024 #define GIT_PACK_CACHE_SIZE_LIMIT 1024 * 1024 /* don't bother caching anything over 1MB */ @@ -86,7 +88,7 @@ struct git_pack_file { git_time_t mtime; unsigned pack_local:1, pack_keep:1, has_cache:1; git_oid sha1; - git_vector cache; + git_oidmap *idx_cache; git_oid **oids; git_pack_cache bases; /* delta base cache */ |