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 12, 2019
2 parents 81bff68 + ff895c0 commit f704632
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 @@ -414,7 +414,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 @@ -434,7 +434,7 @@ static int checkout_paths(const struct checkout_opts *opts,
pos = skip_same_name(ce, pos) - 1;
}
}
enable_fscache(0);
disable_fscache();
remove_marked_cache_entries(&the_index, 1);
remove_scheduled_dirs();
errs |= finish_delayed_checkout(&state, &nr_checkouts);
Expand Down
4 changes: 2 additions & 2 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,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 @@ -1405,7 +1405,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 f704632

Please sign in to comment.