Skip to content

Commit e1dfaac

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 c2e8fb3 + 300d90d commit e1dfaac

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

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
@@ -1377,7 +1377,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13771377
PATHSPEC_PREFER_FULL,
13781378
prefix, argv);
13791379

1380-
enable_fscache(1);
1380+
enable_fscache(0);
13811381
read_cache_preload(&s.pathspec);
13821382
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
13831383

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

14131413
wt_status_print(&s);
1414-
enable_fscache(0);
1414+
disable_fscache();
14151415
return 0;
14161416
}
14171417

0 commit comments

Comments
 (0)