Skip to content

Commit

Permalink
Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
Browse files Browse the repository at this point in the history
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 19, 2018
2 parents 438314b + 1c2f6c8 commit 04d4865
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 145 deletions.
2 changes: 1 addition & 1 deletion builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down
Loading

0 comments on commit 04d4865

Please sign in to comment.