Skip to content

Commit 20805de

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 0fd9966 + b319744 commit 20805de

File tree

10 files changed

+261
-146
lines changed

10 files changed

+261
-146
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
597597
die_in_unpopulated_submodule(&the_index, prefix);
598598
die_path_inside_submodule(&the_index, &pathspec);
599599

600-
enable_fscache(1);
600+
enable_fscache(0);
601601
/* We do not really re-read the index but update the up-to-date flags */
602602
preload_index(&the_index, &pathspec, 0);
603603

builtin/checkout.c

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

394-
enable_fscache(1);
394+
enable_fscache(active_nr);
395395
for (pos = 0; pos < active_nr; pos++) {
396396
struct cache_entry *ce = active_cache[pos];
397397
if (ce->ce_flags & CE_MATCHED) {
@@ -416,7 +416,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
416416
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
417417
NULL, NULL);
418418
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
419-
enable_fscache(0);
419+
disable_fscache();
420420
remove_marked_cache_entries(&the_index, 1);
421421
remove_scheduled_dirs();
422422
errs |= finish_delayed_checkout(&state, &nr_checkouts, opts->show_progress);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15401540
PATHSPEC_PREFER_FULL,
15411541
prefix, argv);
15421542

1543-
enable_fscache(1);
1543+
enable_fscache(0);
15441544
if (status_format != STATUS_FORMAT_PORCELAIN &&
15451545
status_format != STATUS_FORMAT_PORCELAIN_V2)
15461546
progress_flag = REFRESH_PROGRESS;
@@ -1581,7 +1581,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15811581
wt_status_print(&s);
15821582
wt_status_collect_free_buffers(&s);
15831583

1584-
enable_fscache(0);
1584+
disable_fscache();
15851585
return 0;
15861586
}
15871587

0 commit comments

Comments
 (0)