Skip to content

Commit 2d3b493

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 <johannes.schindelin@gmx.de>
2 parents 8d05b91 + 52fc4db commit 2d3b493

File tree

10 files changed

+254
-146
lines changed

10 files changed

+254
-146
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

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);
467467

builtin/checkout.c

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

362362
enable_delayed_checkout(&state);
363-
enable_fscache(1);
363+
enable_fscache(active_nr);
364364
for (pos = 0; pos < active_nr; pos++) {
365365
struct cache_entry *ce = active_cache[pos];
366366
if (ce->ce_flags & CE_MATCHED) {
@@ -375,7 +375,7 @@ static int checkout_paths(const struct checkout_opts *opts,
375375
pos = skip_same_name(ce, pos) - 1;
376376
}
377377
}
378-
enable_fscache(0);
378+
disable_fscache();
379379
errs |= finish_delayed_checkout(&state);
380380

381381
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
@@ -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
read_cache_preload(&s.pathspec);
13811381
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
13821382

@@ -1410,7 +1410,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14101410
s.prefix = prefix;
14111411

14121412
wt_status_print(&s);
1413-
enable_fscache(0);
1413+
disable_fscache();
14141414
return 0;
14151415
}
14161416

0 commit comments

Comments
 (0)