Skip to content

Commit 17310e8

Browse files
dschoderrickstolee
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 329adb6 + d5a98ef commit 17310e8

File tree

10 files changed

+258
-145
lines changed

10 files changed

+258
-145
lines changed

builtin/add.c

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

537-
enable_fscache(1);
537+
enable_fscache(0);
538538
/* We do not really re-read the index but update the up-to-date flags */
539539
preload_index(&the_index, &pathspec, 0);
540540

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
367367
NULL);
368368

369369
enable_delayed_checkout(&state);
370-
enable_fscache(1);
370+
enable_fscache(active_nr);
371371
for (pos = 0; pos < active_nr; pos++) {
372372
struct cache_entry *ce = active_cache[pos];
373373
if (ce->ce_flags & CE_MATCHED) {
@@ -387,7 +387,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
387387
pos = skip_same_name(ce, pos) - 1;
388388
}
389389
}
390-
enable_fscache(0);
390+
disable_fscache();
391391
remove_marked_cache_entries(&the_index, 1);
392392
remove_scheduled_dirs();
393393
errs |= finish_delayed_checkout(&state, &nr_checkouts);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14201420
PATHSPEC_PREFER_FULL,
14211421
prefix, argv);
14221422

1423-
enable_fscache(1);
1423+
enable_fscache(0);
14241424
if (status_format != STATUS_FORMAT_PORCELAIN &&
14251425
status_format != STATUS_FORMAT_PORCELAIN_V2)
14261426
progress_flag = REFRESH_PROGRESS;
@@ -1461,7 +1461,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14611461
wt_status_print(&s);
14621462
wt_status_collect_free_buffers(&s);
14631463

1464-
enable_fscache(0);
1464+
disable_fscache();
14651465
return 0;
14661466
}
14671467

0 commit comments

Comments
 (0)