Skip to content

Commit f704632

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 81bff68 + ff895c0 commit f704632

File tree

10 files changed

+254
-145
lines changed

10 files changed

+254
-145
lines changed

builtin/add.c

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

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

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int checkout_paths(const struct checkout_opts *opts,
414414
state.istate = &the_index;
415415

416416
enable_delayed_checkout(&state);
417-
enable_fscache(1);
417+
enable_fscache(active_nr);
418418
for (pos = 0; pos < active_nr; pos++) {
419419
struct cache_entry *ce = active_cache[pos];
420420
if (ce->ce_flags & CE_MATCHED) {
@@ -434,7 +434,7 @@ static int checkout_paths(const struct checkout_opts *opts,
434434
pos = skip_same_name(ce, pos) - 1;
435435
}
436436
}
437-
enable_fscache(0);
437+
disable_fscache();
438438
remove_marked_cache_entries(&the_index, 1);
439439
remove_scheduled_dirs();
440440
errs |= finish_delayed_checkout(&state, &nr_checkouts);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13641364
PATHSPEC_PREFER_FULL,
13651365
prefix, argv);
13661366

1367-
enable_fscache(1);
1367+
enable_fscache(0);
13681368
if (status_format != STATUS_FORMAT_PORCELAIN &&
13691369
status_format != STATUS_FORMAT_PORCELAIN_V2)
13701370
progress_flag = REFRESH_PROGRESS;
@@ -1405,7 +1405,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14051405
wt_status_print(&s);
14061406
wt_status_collect_free_buffers(&s);
14071407

1408-
enable_fscache(0);
1408+
disable_fscache();
14091409
return 0;
14101410
}
14111411

0 commit comments

Comments
 (0)