Skip to content

Commit 3ae35f3

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 a55440c + 82c9f96 commit 3ae35f3

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
@@ -575,7 +575,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
575575
die_in_unpopulated_submodule(&the_index, prefix);
576576
die_path_inside_submodule(&the_index, &pathspec);
577577

578-
enable_fscache(1);
578+
enable_fscache(0);
579579
/* We do not really re-read the index but update the up-to-date flags */
580580
preload_index(&the_index, &pathspec, 0);
581581

builtin/checkout.c

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

381-
enable_fscache(1);
381+
enable_fscache(active_nr);
382382
for (pos = 0; pos < active_nr; pos++) {
383383
struct cache_entry *ce = active_cache[pos];
384384
if (ce->ce_flags & CE_MATCHED) {
@@ -403,7 +403,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
403403
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
404404
NULL, NULL);
405405
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
406-
enable_fscache(0);
406+
disable_fscache();
407407
remove_marked_cache_entries(&the_index, 1);
408408
remove_scheduled_dirs();
409409
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
@@ -1539,7 +1539,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15391539
PATHSPEC_PREFER_FULL,
15401540
prefix, argv);
15411541

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

1583-
enable_fscache(0);
1583+
disable_fscache();
15841584
return 0;
15851585
}
15861586

0 commit comments

Comments
 (0)