Skip to content

Commit

Permalink
perf, fix writing files performance by disabling fsync (#7226)
Browse files Browse the repository at this point in the history
Writing object files is 16 times faster with this change. See
npm/write-file-atomic#155 for more info.
  • Loading branch information
davidfirst committed Mar 31, 2023
1 parent 614b6c7 commit 6678690
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/fs-write-file.ts
Expand Up @@ -19,5 +19,5 @@ export default async function writeFile(
chown = { uid: options.uid || user.uid, gid: options.gid || user.gid };
}
await fs.ensureDir(pathLib.dirname(path));
await writeFileAtomic(path, contents, { chown });
await writeFileAtomic(path, contents, { chown, fsync: false });
}

0 comments on commit 6678690

Please sign in to comment.