Skip to content

Commit 7979589

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 814d563 + 1727b7e commit 7979589

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
@@ -1384,7 +1384,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13841384
PATHSPEC_PREFER_FULL,
13851385
prefix, argv);
13861386

1387-
enable_fscache(1);
1387+
enable_fscache(0);
13881388
if (status_format != STATUS_FORMAT_PORCELAIN &&
13891389
status_format != STATUS_FORMAT_PORCELAIN_V2)
13901390
progress_flag = REFRESH_PROGRESS;
@@ -1425,7 +1425,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14251425
wt_status_print(&s);
14261426
wt_status_collect_free_buffers(&s);
14271427

1428-
enable_fscache(0);
1428+
disable_fscache();
14291429
return 0;
14301430
}
14311431

0 commit comments

Comments
 (0)