Skip to content

Commit 953918c

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 aec157c + c203993 commit 953918c

File tree

10 files changed

+261
-146
lines changed

10 files changed

+261
-146
lines changed

builtin/add.c

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

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

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
386386
if (pc_workers > 1)
387387
init_parallel_checkout();
388388

389-
enable_fscache(1);
389+
enable_fscache(active_nr);
390390
for (pos = 0; pos < active_nr; pos++) {
391391
struct cache_entry *ce = active_cache[pos];
392392
if (ce->ce_flags & CE_MATCHED) {
@@ -411,7 +411,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
411411
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
412412
NULL, NULL);
413413
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
414-
enable_fscache(0);
414+
disable_fscache();
415415
remove_marked_cache_entries(&the_index, 1);
416416
remove_scheduled_dirs();
417417
errs |= finish_delayed_checkout(&state, &nr_checkouts, opts->show_progress);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15411541
PATHSPEC_PREFER_FULL,
15421542
prefix, argv);
15431543

1544-
enable_fscache(1);
1544+
enable_fscache(0);
15451545
if (status_format != STATUS_FORMAT_PORCELAIN &&
15461546
status_format != STATUS_FORMAT_PORCELAIN_V2)
15471547
progress_flag = REFRESH_PROGRESS;
@@ -1582,7 +1582,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15821582
wt_status_print(&s);
15831583
wt_status_collect_free_buffers(&s);
15841584

1585-
enable_fscache(0);
1585+
disable_fscache();
15861586
return 0;
15871587
}
15881588

0 commit comments

Comments
 (0)