Skip to content

Commit cdea8c1

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 7d55573 + be31061 commit cdea8c1

File tree

10 files changed

+258
-146
lines changed

10 files changed

+258
-146
lines changed

builtin/add.c

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

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

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);

builtin/commit.c

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

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

1582-
enable_fscache(0);
1582+
disable_fscache();
15831583
return 0;
15841584
}
15851585

0 commit comments

Comments
 (0)