Skip to content

Commit 272795a

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 236a1e8 + 57e6ec2 commit 272795a

File tree

10 files changed

+262
-146
lines changed

10 files changed

+262
-146
lines changed

builtin/add.c

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

556-
enable_fscache(1);
556+
enable_fscache(0);
557557
/* We do not really re-read the index but update the up-to-date flags */
558558
preload_index(&the_index, &pathspec, 0);
559559

builtin/checkout.c

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

404-
enable_fscache(1);
404+
enable_fscache(the_index.cache_nr);
405405
for (pos = 0; pos < the_index.cache_nr; pos++) {
406406
struct cache_entry *ce = the_index.cache[pos];
407407
if (ce->ce_flags & CE_MATCHED) {
@@ -426,7 +426,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
426426
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
427427
NULL, NULL);
428428
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
429-
enable_fscache(0);
429+
disable_fscache();
430430
remove_marked_cache_entries(&the_index, 1);
431431
remove_scheduled_dirs();
432432
errs |= finish_delayed_checkout(&state, opts->show_progress);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15621562
PATHSPEC_PREFER_FULL,
15631563
prefix, argv);
15641564

1565-
enable_fscache(1);
1565+
enable_fscache(0);
15661566
if (status_format != STATUS_FORMAT_PORCELAIN &&
15671567
status_format != STATUS_FORMAT_PORCELAIN_V2)
15681568
progress_flag = REFRESH_PROGRESS;
@@ -1603,7 +1603,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16031603
wt_status_print(&s);
16041604
wt_status_collect_free_buffers(&s);
16051605

1606-
enable_fscache(0);
1606+
disable_fscache();
16071607
return 0;
16081608
}
16091609

0 commit comments

Comments
 (0)