Skip to content

Commit 8948d8f

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 e388c13 + 9f58d12 commit 8948d8f

File tree

10 files changed

+256
-145
lines changed

10 files changed

+256
-145
lines changed

builtin/add.c

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

503-
enable_fscache(1);
503+
enable_fscache(0);
504504
/* We do not really re-read the index but update the up-to-date flags */
505505
preload_index(&the_index, &pathspec, 0);
506506

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ static int checkout_worktree(const struct checkout_opts *opts)
345345
state.refresh_cache = 1;
346346
state.istate = &the_index;
347347

348-
enable_fscache(1);
349348
enable_delayed_checkout(&state);
349+
enable_fscache(active_nr);
350350
for (pos = 0; pos < active_nr; pos++) {
351351
struct cache_entry *ce = active_cache[pos];
352352
if (ce->ce_flags & CE_MATCHED) {
@@ -368,8 +368,8 @@ static int checkout_worktree(const struct checkout_opts *opts)
368368
}
369369
remove_marked_cache_entries(&the_index, 1);
370370
remove_scheduled_dirs();
371+
disable_fscache();
371372
errs |= finish_delayed_checkout(&state, &nr_checkouts);
372-
enable_fscache(0);
373373

374374
if (opts->count_checkout_paths) {
375375
if (nr_unmerged)

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13761376
PATHSPEC_PREFER_FULL,
13771377
prefix, argv);
13781378

1379-
enable_fscache(1);
1379+
enable_fscache(0);
13801380
if (status_format != STATUS_FORMAT_PORCELAIN &&
13811381
status_format != STATUS_FORMAT_PORCELAIN_V2)
13821382
progress_flag = REFRESH_PROGRESS;
@@ -1417,7 +1417,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14171417
wt_status_print(&s);
14181418
wt_status_collect_free_buffers(&s);
14191419

1420-
enable_fscache(0);
1420+
disable_fscache();
14211421
return 0;
14221422
}
14231423

0 commit comments

Comments
 (0)