Skip to content

Commit f05fe6e

Browse files
committed
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 <[email protected]>
2 parents 93afe6c + 05bed69 commit f05fe6e

File tree

10 files changed

+258
-145
lines changed

10 files changed

+258
-145
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
540540
die_in_unpopulated_submodule(&the_index, prefix);
541541
die_path_inside_submodule(&the_index, &pathspec);
542542

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

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
368368
NULL);
369369

370370
enable_delayed_checkout(&state);
371-
enable_fscache(1);
371+
enable_fscache(active_nr);
372372
for (pos = 0; pos < active_nr; pos++) {
373373
struct cache_entry *ce = active_cache[pos];
374374
if (ce->ce_flags & CE_MATCHED) {
@@ -388,7 +388,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
388388
pos = skip_same_name(ce, pos) - 1;
389389
}
390390
}
391-
enable_fscache(0);
391+
disable_fscache();
392392
remove_marked_cache_entries(&the_index, 1);
393393
remove_scheduled_dirs();
394394
errs |= finish_delayed_checkout(&state, &nr_checkouts);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14181418
PATHSPEC_PREFER_FULL,
14191419
prefix, argv);
14201420

1421-
enable_fscache(1);
1421+
enable_fscache(0);
14221422
if (status_format != STATUS_FORMAT_PORCELAIN &&
14231423
status_format != STATUS_FORMAT_PORCELAIN_V2)
14241424
progress_flag = REFRESH_PROGRESS;
@@ -1459,7 +1459,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14591459
wt_status_print(&s);
14601460
wt_status_collect_free_buffers(&s);
14611461

1462-
enable_fscache(0);
1462+
disable_fscache();
14631463
return 0;
14641464
}
14651465

0 commit comments

Comments
 (0)