Skip to content

Commit 68272a7

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 3671897 + 084ce83 commit 68272a7

File tree

10 files changed

+258
-145
lines changed

10 files changed

+258
-145
lines changed

builtin/add.c

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

532-
enable_fscache(1);
532+
enable_fscache(0);
533533
/* We do not really re-read the index but update the up-to-date flags */
534534
preload_index(&the_index, &pathspec, 0);
535535

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int checkout_worktree(const struct checkout_opts *opts)
349349
state.istate = &the_index;
350350

351351
enable_delayed_checkout(&state);
352-
enable_fscache(1);
352+
enable_fscache(active_nr);
353353
for (pos = 0; pos < active_nr; pos++) {
354354
struct cache_entry *ce = active_cache[pos];
355355
if (ce->ce_flags & CE_MATCHED) {
@@ -369,7 +369,7 @@ static int checkout_worktree(const struct checkout_opts *opts)
369369
pos = skip_same_name(ce, pos) - 1;
370370
}
371371
}
372-
enable_fscache(0);
372+
disable_fscache();
373373
remove_marked_cache_entries(&the_index, 1);
374374
remove_scheduled_dirs();
375375
errs |= finish_delayed_checkout(&state, &nr_checkouts);

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14141414
PATHSPEC_PREFER_FULL,
14151415
prefix, argv);
14161416

1417-
enable_fscache(1);
1417+
enable_fscache(0);
14181418
if (status_format != STATUS_FORMAT_PORCELAIN &&
14191419
status_format != STATUS_FORMAT_PORCELAIN_V2)
14201420
progress_flag = REFRESH_PROGRESS;
@@ -1455,7 +1455,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14551455
wt_status_print(&s);
14561456
wt_status_collect_free_buffers(&s);
14571457

1458-
enable_fscache(0);
1458+
disable_fscache();
14591459
return 0;
14601460
}
14611461

0 commit comments

Comments
 (0)