Skip to content

Commit 4153aad

Browse files
dschomjcheetham
authored andcommitted
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 550c9fa + 6200027 commit 4153aad

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

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

builtin/checkout.c

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

406-
enable_fscache(1);
406+
enable_fscache(the_repository->index->cache_nr);
407407
for (pos = 0; pos < the_repository->index->cache_nr; pos++) {
408408
struct cache_entry *ce = the_repository->index->cache[pos];
409409
if (ce->ce_flags & CE_MATCHED) {
@@ -429,7 +429,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
429429
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
430430
NULL, NULL);
431431
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
432-
enable_fscache(0);
432+
disable_fscache();
433433
remove_marked_cache_entries(the_repository->index, 1);
434434
remove_scheduled_dirs();
435435
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
@@ -1568,7 +1568,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15681568
PATHSPEC_PREFER_FULL,
15691569
prefix, argv);
15701570

1571-
enable_fscache(1);
1571+
enable_fscache(0);
15721572
if (status_format != STATUS_FORMAT_PORCELAIN &&
15731573
status_format != STATUS_FORMAT_PORCELAIN_V2)
15741574
progress_flag = REFRESH_PROGRESS;
@@ -1609,7 +1609,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16091609
wt_status_print(&s);
16101610
wt_status_collect_free_buffers(&s);
16111611

1612-
enable_fscache(0);
1612+
disable_fscache();
16131613
return 0;
16141614
}
16151615

0 commit comments

Comments
 (0)