mirror of
https://github.com/git/git.git
synced 2026-01-29 11:59:21 +00:00
name-hash: precompute hash values during preload-index
Precompute the istate.name_hash and istate.dir_hash values for each cache-entry during the preload-index phase. Move the expensive memihash() calculations from lazy_init_name_hash() to the multi-threaded preload-index phase. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
committed by
Johannes Schindelin
parent
d484faac20
commit
d27bd052d2
16
cache.h
16
cache.h
@@ -173,6 +173,9 @@ struct cache_entry {
|
||||
unsigned int ce_flags;
|
||||
unsigned int ce_namelen;
|
||||
unsigned int index; /* for link extension */
|
||||
unsigned int precompute_hash_state;
|
||||
unsigned int precompute_hash_name;
|
||||
unsigned int precompute_hash_dir;
|
||||
struct object_id oid;
|
||||
char name[FLEX_ARRAY]; /* more */
|
||||
};
|
||||
@@ -229,6 +232,19 @@ struct cache_entry {
|
||||
#error "CE_EXTENDED_FLAGS out of range"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Bit set if preload-index precomputed the hash value(s)
|
||||
* for this cache-entry.
|
||||
*/
|
||||
#define CE_PRECOMPUTE_HASH_STATE__SET (1 << 0)
|
||||
/*
|
||||
* Bit set if precompute-index also precomputed the hash value
|
||||
* for the parent directory.
|
||||
*/
|
||||
#define CE_PRECOMPUTE_HASH_STATE__DIR (1 << 1)
|
||||
|
||||
void precompute_istate_hashes(struct cache_entry *ce);
|
||||
|
||||
/* Forward structure decls */
|
||||
struct pathspec;
|
||||
struct child_process;
|
||||
|
||||
Reference in New Issue
Block a user