Skip to content

Commit f0b5880

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 244b331 + d2d53d5 commit f0b5880

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
@@ -464,7 +464,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
464464
die_in_unpopulated_submodule(&the_index, prefix);
465465
die_path_inside_submodule(&the_index, &pathspec);
466466

467-
enable_fscache(1);
467+
enable_fscache(0);
468468
/* We do not really re-read the index but update the up-to-date flags */
469469
preload_index(&the_index, &pathspec, 0);
470470

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
@@ -1558,7 +1558,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15581558
PATHSPEC_PREFER_FULL,
15591559
prefix, argv);
15601560

1561-
enable_fscache(1);
1561+
enable_fscache(0);
15621562
if (status_format != STATUS_FORMAT_PORCELAIN &&
15631563
status_format != STATUS_FORMAT_PORCELAIN_V2)
15641564
progress_flag = REFRESH_PROGRESS;
@@ -1599,7 +1599,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15991599
wt_status_print(&s);
16001600
wt_status_collect_free_buffers(&s);
16011601

1602-
enable_fscache(0);
1602+
disable_fscache();
16031603
return 0;
16041604
}
16051605

0 commit comments

Comments
 (0)