Skip to content

Commit 31ec0f5

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 9ac3e99 + 39bda77 commit 31ec0f5

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
@@ -461,7 +461,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
461461
die_in_unpopulated_submodule(&the_index, prefix);
462462
die_path_inside_submodule(&the_index, &pathspec);
463463

464-
enable_fscache(1);
464+
enable_fscache(0);
465465
/* We do not really re-read the index but update the up-to-date flags */
466466
preload_index(&the_index, &pathspec, 0);
467467

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) {
@@ -430,7 +430,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
430430
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
431431
NULL, NULL);
432432
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
433-
enable_fscache(0);
433+
disable_fscache();
434434
remove_marked_cache_entries(&the_index, 1);
435435
remove_scheduled_dirs();
436436
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
@@ -1582,7 +1582,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15821582
PATHSPEC_PREFER_FULL,
15831583
prefix, argv);
15841584

1585-
enable_fscache(1);
1585+
enable_fscache(0);
15861586
if (status_format != STATUS_FORMAT_PORCELAIN &&
15871587
status_format != STATUS_FORMAT_PORCELAIN_V2)
15881588
progress_flag = REFRESH_PROGRESS;
@@ -1623,7 +1623,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16231623
wt_status_print(&s);
16241624
wt_status_collect_free_buffers(&s);
16251625

1626-
enable_fscache(0);
1626+
disable_fscache();
16271627
return 0;
16281628
}
16291629

0 commit comments

Comments
 (0)