Skip to content

Commit eecbe65

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 c6334a1 + a2458de commit eecbe65

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

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

builtin/checkout.c

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

410-
enable_fscache(1);
410+
enable_fscache(the_repository->index->cache_nr);
411411
for (pos = 0; pos < the_repository->index->cache_nr; pos++) {
412412
struct cache_entry *ce = the_repository->index->cache[pos];
413413
if (ce->ce_flags & CE_MATCHED) {
@@ -433,7 +433,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
433433
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
434434
NULL, NULL);
435435
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
436-
enable_fscache(0);
436+
disable_fscache();
437437
remove_marked_cache_entries(the_repository->index, 1);
438438
remove_scheduled_dirs();
439439
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
@@ -1583,7 +1583,7 @@ struct repository *repo UNUSED)
15831583
PATHSPEC_PREFER_FULL,
15841584
prefix, argv);
15851585

1586-
enable_fscache(1);
1586+
enable_fscache(0);
15871587
if (status_format != STATUS_FORMAT_PORCELAIN &&
15881588
status_format != STATUS_FORMAT_PORCELAIN_V2)
15891589
progress_flag = REFRESH_PROGRESS;
@@ -1624,7 +1624,7 @@ struct repository *repo UNUSED)
16241624
wt_status_print(&s);
16251625
wt_status_collect_free_buffers(&s);
16261626

1627-
enable_fscache(0);
1627+
disable_fscache();
16281628
return 0;
16291629
}
16301630

0 commit comments

Comments
 (0)