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 Feb 7, 2019
2 parents d9f8dcf + f0ed41c commit d94e364
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_in_unpopulated_submodule(&the_index, 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, 0);

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

if (opts->count_checkout_paths) {
Expand Down
4 changes: 2 additions & 2 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
PATHSPEC_PREFER_FULL,
prefix, argv);

enable_fscache(1);
enable_fscache(0);
if (status_format != STATUS_FORMAT_PORCELAIN &&
status_format != STATUS_FORMAT_PORCELAIN_V2)
progress_flag = REFRESH_PROGRESS;
Expand Down Expand Up @@ -1407,7 +1407,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
wt_status_print(&s);
wt_status_collect_free_buffers(&s);

enable_fscache(0);
disable_fscache();
return 0;
}

Expand Down
Loading

0 comments on commit d94e364

Please sign in to comment.