Skip to content

Commit 26104e9

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 f4fa1d0 + cae92c0 commit 26104e9

File tree

10 files changed

+255
-145
lines changed

10 files changed

+255
-145
lines changed

builtin/add.c

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

465-
enable_fscache(1);
465+
enable_fscache(0);
466466
/* We do not really re-read the index but update the up-to-date flags */
467467
preload_index(&the_index, &pathspec, 0);
468468

builtin/checkout.c

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

348348
enable_delayed_checkout(&state);
349-
enable_fscache(1);
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) {
@@ -366,7 +366,7 @@ static int checkout_worktree(const struct checkout_opts *opts)
366366
pos = skip_same_name(ce, pos) - 1;
367367
}
368368
}
369-
enable_fscache(0);
369+
disable_fscache();
370370
remove_marked_cache_entries(&the_index, 1);
371371
remove_scheduled_dirs();
372372
errs |= finish_delayed_checkout(&state, &nr_checkouts);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13711371
PATHSPEC_PREFER_FULL,
13721372
prefix, argv);
13731373

1374-
enable_fscache(1);
1374+
enable_fscache(0);
13751375
if (status_format != STATUS_FORMAT_PORCELAIN &&
13761376
status_format != STATUS_FORMAT_PORCELAIN_V2)
13771377
progress_flag = REFRESH_PROGRESS;
@@ -1412,7 +1412,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14121412
wt_status_print(&s);
14131413
wt_status_collect_free_buffers(&s);
14141414

1415-
enable_fscache(0);
1415+
disable_fscache();
14161416
return 0;
14171417
}
14181418

0 commit comments

Comments
 (0)