Skip to content

Commit 80ed4e6

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 9370b56 + 8b91728 commit 80ed4e6

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
@@ -460,7 +460,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
460460
die_in_unpopulated_submodule(&the_index, prefix);
461461
die_path_inside_submodule(&the_index, &pathspec);
462462

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

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int checkout_paths(const struct checkout_opts *opts,
367367
state.istate = &the_index;
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) {
@@ -382,7 +382,7 @@ static int checkout_paths(const struct checkout_opts *opts,
382382
pos = skip_same_name(ce, pos) - 1;
383383
}
384384
}
385-
enable_fscache(0);
385+
disable_fscache();
386386
errs |= finish_delayed_checkout(&state);
387387

388388
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))

builtin/commit.c

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

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

1407-
enable_fscache(0);
1407+
disable_fscache();
14081408
return 0;
14091409
}
14101410

0 commit comments

Comments
 (0)