Skip to content

Commit 9cee003

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 6edba9b + 08caca6 commit 9cee003

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
@@ -550,7 +550,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
550550
die_in_unpopulated_submodule(&the_index, prefix);
551551
die_path_inside_submodule(&the_index, &pathspec);
552552

553-
enable_fscache(1);
553+
enable_fscache(0);
554554
/* We do not really re-read the index but update the up-to-date flags */
555555
preload_index(&the_index, &pathspec, 0);
556556

builtin/checkout.c

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

396-
enable_fscache(1);
396+
enable_fscache(the_index.cache_nr);
397397
for (pos = 0; pos < the_index.cache_nr; pos++) {
398398
struct cache_entry *ce = the_index.cache[pos];
399399
if (ce->ce_flags & CE_MATCHED) {
@@ -418,7 +418,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
418418
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
419419
NULL, NULL);
420420
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
421-
enable_fscache(0);
421+
disable_fscache();
422422
remove_marked_cache_entries(&the_index, 1);
423423
remove_scheduled_dirs();
424424
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
@@ -1554,7 +1554,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15541554
PATHSPEC_PREFER_FULL,
15551555
prefix, argv);
15561556

1557-
enable_fscache(1);
1557+
enable_fscache(0);
15581558
if (status_format != STATUS_FORMAT_PORCELAIN &&
15591559
status_format != STATUS_FORMAT_PORCELAIN_V2)
15601560
progress_flag = REFRESH_PROGRESS;
@@ -1595,7 +1595,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15951595
wt_status_print(&s);
15961596
wt_status_collect_free_buffers(&s);
15971597

1598-
enable_fscache(0);
1598+
disable_fscache();
15991599
return 0;
16001600
}
16011601

0 commit comments

Comments
 (0)