Skip to content
Permalink
Browse files

Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'

This brings substantial wins in performance because the FSCache is now
per-thread, being merged to the primary thread only at the end, so we do
not have to lock (except while merging).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Nov 16, 2018
2 parents 8d05b91 + 52fc4db commit 2d3b4935cc1b50d727847ca68486be4395416a58
Showing with 254 additions and 146 deletions.
  1. +1 −1 builtin/add.c
  2. +2 −2 builtin/checkout.c
  3. +2 −2 builtin/commit.c
  4. +200 −133 compat/win32/fscache.c
  5. +19 −2 compat/win32/fscache.h
  6. +2 −2 fetch-pack.c
  7. +16 −0 git-compat-util.h
  8. +5 −0 mem-pool.c
  9. +5 −2 preload-index.c
  10. +2 −2 read-cache.c
@@ -461,7 +461,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)

die_path_inside_submodule(&the_index, &pathspec);

enable_fscache(1);
enable_fscache(0);
/* We do not really re-read the index but update the up-to-date flags */
preload_index(&the_index, &pathspec);

@@ -360,7 +360,7 @@ static int checkout_paths(const struct checkout_opts *opts,
state.istate = &the_index;

enable_delayed_checkout(&state);
enable_fscache(1);
enable_fscache(active_nr);
for (pos = 0; pos < active_nr; pos++) {
struct cache_entry *ce = active_cache[pos];
if (ce->ce_flags & CE_MATCHED) {
@@ -375,7 +375,7 @@ static int checkout_paths(const struct checkout_opts *opts,
pos = skip_same_name(ce, pos) - 1;
}
}
enable_fscache(0);
disable_fscache();
errs |= finish_delayed_checkout(&state);

if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
@@ -1376,7 +1376,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
PATHSPEC_PREFER_FULL,
prefix, argv);

enable_fscache(1);
enable_fscache(0);
read_cache_preload(&s.pathspec);
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);

@@ -1410,7 +1410,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
s.prefix = prefix;

wt_status_print(&s);
enable_fscache(0);
disable_fscache();
return 0;
}

0 comments on commit 2d3b493

Please sign in to comment.
You can’t perform that action at this time.