Skip to content

Commit eab8690

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 b770ed5 + 20fae40 commit eab8690

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
@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
467467
die_in_unpopulated_submodule(&the_index, prefix);
468468
die_path_inside_submodule(&the_index, &pathspec);
469469

470-
enable_fscache(1);
470+
enable_fscache(0);
471471
/* We do not really re-read the index but update the up-to-date flags */
472472
preload_index(&the_index, &pathspec, 0);
473473

builtin/checkout.c

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

407-
enable_fscache(1);
407+
enable_fscache(the_index.cache_nr);
408408
for (pos = 0; pos < the_index.cache_nr; pos++) {
409409
struct cache_entry *ce = the_index.cache[pos];
410410
if (ce->ce_flags & CE_MATCHED) {
@@ -429,7 +429,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
429429
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
430430
NULL, NULL);
431431
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
432-
enable_fscache(0);
432+
disable_fscache();
433433
remove_marked_cache_entries(&the_index, 1);
434434
remove_scheduled_dirs();
435435
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
@@ -1566,7 +1566,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15661566
PATHSPEC_PREFER_FULL,
15671567
prefix, argv);
15681568

1569-
enable_fscache(1);
1569+
enable_fscache(0);
15701570
if (status_format != STATUS_FORMAT_PORCELAIN &&
15711571
status_format != STATUS_FORMAT_PORCELAIN_V2)
15721572
progress_flag = REFRESH_PROGRESS;
@@ -1607,7 +1607,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16071607
wt_status_print(&s);
16081608
wt_status_collect_free_buffers(&s);
16091609

1610-
enable_fscache(0);
1610+
disable_fscache();
16111611
return 0;
16121612
}
16131613

0 commit comments

Comments
 (0)