Skip to content

Commit 16cb9f5

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 ee53250 + ce8df9f commit 16cb9f5

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

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

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
@@ -1580,7 +1580,7 @@ struct repository *repo UNUSED)
15801580
PATHSPEC_PREFER_FULL,
15811581
prefix, argv);
15821582

1583-
enable_fscache(1);
1583+
enable_fscache(0);
15841584
if (status_format != STATUS_FORMAT_PORCELAIN &&
15851585
status_format != STATUS_FORMAT_PORCELAIN_V2)
15861586
progress_flag = REFRESH_PROGRESS;
@@ -1621,7 +1621,7 @@ struct repository *repo UNUSED)
16211621
wt_status_print(&s);
16221622
wt_status_collect_free_buffers(&s);
16231623

1624-
enable_fscache(0);
1624+
disable_fscache();
16251625
return 0;
16261626
}
16271627

0 commit comments

Comments
 (0)