From b9701f6d27ca0b1430bb3e9999efe9c9c7be8541 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Mon, 25 Sep 2023 23:46:29 +0100 Subject: [PATCH] fixup! fs: improve error perf of sync `*times` --- benchmark/fs/bench-timesSync.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/benchmark/fs/bench-timesSync.js b/benchmark/fs/bench-timesSync.js index 125d636c536e03..8ea879a63ef9b7 100644 --- a/benchmark/fs/bench-timesSync.js +++ b/benchmark/fs/bench-timesSync.js @@ -15,8 +15,6 @@ function main({ n, type, func }) { const useFds = func === 'futimes'; const fsFunc = fs[func + 'Sync']; - const time = Date.now() / 1000; - switch (type) { case 'existing': { const files = []; @@ -30,7 +28,7 @@ function main({ n, type, func }) { bench.start(); for (let i = 0; i < n; i++) { - fsFunc(files[i], time, time); + fsFunc(files[i], i, i); } bench.end(n); @@ -45,12 +43,10 @@ function main({ n, type, func }) { break; } case 'non-existing': { - const file = useFds ? (1 << 30) : tmpdir.resolve(`.non-existing-file-${Date.now()}`); - bench.start(); for (let i = 0; i < n; i++) { try { - fsFunc(file, time, time); + fsFunc(useFds ? (1 << 30) : tmpdir.resolve(`.non-existing-file-${Date.now()}`), i, i); } catch { // do nothing }