Skip to content

Commit 77b1db5

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 466ba3b + b8f8cdc commit 77b1db5

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
@@ -475,7 +475,7 @@ int cmd_add(int argc,
475475
die_in_unpopulated_submodule(repo->index, prefix);
476476
die_path_inside_submodule(repo->index, &pathspec);
477477

478-
enable_fscache(1);
478+
enable_fscache(0);
479479
/* We do not really re-read the index but update the up-to-date flags */
480480
preload_index(repo->index, &pathspec, 0);
481481

builtin/checkout.c

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

408-
enable_fscache(1);
408+
enable_fscache(the_repository->index->cache_nr);
409409
for (pos = 0; pos < the_repository->index->cache_nr; pos++) {
410410
struct cache_entry *ce = the_repository->index->cache[pos];
411411
if (ce->ce_flags & CE_MATCHED) {
@@ -431,7 +431,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
431431
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
432432
NULL, NULL);
433433
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
434-
enable_fscache(0);
434+
disable_fscache();
435435
remove_marked_cache_entries(the_repository->index, 1);
436436
remove_scheduled_dirs();
437437
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
@@ -1575,7 +1575,7 @@ struct repository *repo UNUSED)
15751575
PATHSPEC_PREFER_FULL,
15761576
prefix, argv);
15771577

1578-
enable_fscache(1);
1578+
enable_fscache(0);
15791579
if (status_format != STATUS_FORMAT_PORCELAIN &&
15801580
status_format != STATUS_FORMAT_PORCELAIN_V2)
15811581
progress_flag = REFRESH_PROGRESS;
@@ -1616,7 +1616,7 @@ struct repository *repo UNUSED)
16161616
wt_status_print(&s);
16171617
wt_status_collect_free_buffers(&s);
16181618

1619-
enable_fscache(0);
1619+
disable_fscache();
16201620
return 0;
16211621
}
16221622

0 commit comments

Comments
 (0)