From 9388b3f8257bc2e580deaece4cd2677928104fc6 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 2 Mar 2023 19:02:10 -0800 Subject: Add a zig fmt action (#2277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a zig fmt action * add failing file * Setup prettier better * Update prettier-fmt.yml * Fail on error * Update prettier-fmt.yml * boop * boop2 * tar.gz * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * boop * Update prettier-fmt.yml * tag * newlines * multiline * fixup * Update zig-fmt.yml * update it * fixup * both * w * Update prettier-fmt.yml * prettier all the things * Update package.json * zig fmt * ❌ ✅ * bump * . * quotes * fix prettier ignore * once more * Update prettier-fmt.yml * Update fallback.ts * consistentcy --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- .../css-stress-test/read-frames.js | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'bench/hot-module-reloading/css-stress-test/read-frames.js') diff --git a/bench/hot-module-reloading/css-stress-test/read-frames.js b/bench/hot-module-reloading/css-stress-test/read-frames.js index 9e264b4df..089e97e83 100644 --- a/bench/hot-module-reloading/css-stress-test/read-frames.js +++ b/bench/hot-module-reloading/css-stress-test/read-frames.js @@ -4,9 +4,7 @@ const path = require("path"); const PROJECT = process.env.PROJECT || "bun"; const percentile = require("percentile"); const PACKAGE_NAME = process.env.PACKAGE_NAME; -const label = `${PACKAGE_NAME}@${ - require(PACKAGE_NAME + "/package.json").version -}`; +const label = `${PACKAGE_NAME}@${require(PACKAGE_NAME + "/package.json").version}`; const BASEFOLDER = path.resolve(PROJECT); const OUTFILE = path.join(process.cwd(), process.env.OUTFILE); @@ -20,10 +18,10 @@ const TOTAL_FRAMES = VALID_TIMES.length; const timings = fs .readFileSync(BASEFOLDER + "/frames.all.clean", "utf8") .split("\n") - .map((a) => a.replace(/[Ran:'\.]?/gm, "").trim()) - .filter((a) => parseInt(a, 10)) - .filter((a) => a.length > 0 && VALID_TIMES.includes(BigInt(parseInt(a, 10)))) - .map((num) => BigInt(num)); + .map(a => a.replace(/[Ran:'\.]?/gm, "").trim()) + .filter(a => parseInt(a, 10)) + .filter(a => a.length > 0 && VALID_TIMES.includes(BigInt(parseInt(a, 10)))) + .map(num => BigInt(num)); timings.sort(); @@ -47,7 +45,7 @@ const report = { name: PACKAGE_NAME, version: require(PACKAGE_NAME + "/package.json").version, }, - timestamps: timings.map((a) => Number(a)), + timestamps: timings.map(a => Number(a)), frameTimes: frameTime, percentileMs: { 50: percentile(50, frameTime) / 10, @@ -67,9 +65,7 @@ fs.writeFileSync( "." + process.env.SLEEP_INTERVAL + "ms." + - `${process.platform}-${ - process.arch === "arm64" ? "aarch64" : process.arch - }` + + `${process.platform}-${process.arch === "arm64" ? "aarch64" : process.arch}` + ".json", ), JSON.stringify(report, null, 2), @@ -99,9 +95,5 @@ console.log( timings.length, "/", TOTAL_FRAMES, - "(" + - Math.round( - Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100, - ) + - "%)", + "(" + Math.round(Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100) + "%)", ); -- cgit v1.2.3