Skip to content

Commit 64204c8

Browse files
committed
mingw: let core.fsyncObjectFiles default to the batch mode
For several years, Git for Windows ran with the `core.fsyncObjectFiles` mode enabled. This forced the disk to be synchronized after each and every loose object file was written, adding a substantial layer of safety (otherwise, a crash of the Operating System might have left files in place of the correct size, but filled with NUL bytes). In contrast to what this maintainers' assessment of the performance implications was (namely, that they should be negligible), it turns out that in particular when working on large monorepos, it _does_ have a high impact. In late 2021, Git learned a batched mode in the meantime, a mode that would batch those synchronizations, which strikes a better balance between safety and performance. Let's switch to that mode as the new default. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ae393d5 commit 64204c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

environment.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const char *git_attributes_file;
4242
const char *git_hooks_path;
4343
int zlib_compression_level = Z_BEST_SPEED;
4444
int pack_compression_level = Z_DEFAULT_COMPRESSION;
45-
enum fsync_object_files_mode fsync_object_files;
45+
enum fsync_object_files_mode fsync_object_files = FSYNC_OBJECT_FILES_BATCH;
4646
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
4747
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
4848
size_t delta_base_cache_limit = 96 * 1024 * 1024;

0 commit comments

Comments
 (0)