mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
This commit is contained in:
@@ -461,6 +461,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||
|
||||
die_path_inside_submodule(&the_index, &pathspec);
|
||||
|
||||
enable_fscache(1);
|
||||
/* We do not really re-read the index but update the up-to-date flags */
|
||||
preload_index(&the_index, &pathspec);
|
||||
|
||||
if (add_new_files) {
|
||||
int baselen;
|
||||
|
||||
|
||||
1
cache.h
1
cache.h
@@ -659,6 +659,7 @@ extern int daemonize(void);
|
||||
/* Initialize and use the cache information */
|
||||
struct lock_file;
|
||||
extern int read_index(struct index_state *);
|
||||
extern void preload_index(struct index_state *, const struct pathspec *pathspec);
|
||||
extern int read_index_preload(struct index_state *, const struct pathspec *pathspec);
|
||||
extern int do_read_index(struct index_state *istate, const char *path,
|
||||
int must_exist); /* for testting only! */
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
#include "fsmonitor.h"
|
||||
|
||||
#ifdef NO_PTHREADS
|
||||
static void preload_index(struct index_state *index,
|
||||
const struct pathspec *pathspec)
|
||||
void preload_index(struct index_state *index, const struct pathspec *pathspec)
|
||||
{
|
||||
; /* nothing */
|
||||
}
|
||||
@@ -73,8 +72,7 @@ static void *preload_thread(void *_data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void preload_index(struct index_state *index,
|
||||
const struct pathspec *pathspec)
|
||||
void preload_index(struct index_state *index, const struct pathspec *pathspec)
|
||||
{
|
||||
int threads, i, work, offset;
|
||||
struct thread_data data[MAX_PARALLEL];
|
||||
|
||||
Reference in New Issue
Block a user