diff options
author | 2023-03-02 19:02:10 -0800 | |
---|---|---|
committer | 2023-03-02 19:02:10 -0800 | |
commit | 9388b3f8257bc2e580deaece4cd2677928104fc6 (patch) | |
tree | 3f6aff2009cef69897f599fe51305b894f81a376 /bench/hot-module-reloading/css-stress-test/read-frames.js | |
parent | b469e5035161286abeb1a7726518d1afcc163a51 (diff) | |
download | bun-9388b3f8257bc2e580deaece4cd2677928104fc6.tar.gz bun-9388b3f8257bc2e580deaece4cd2677928104fc6.tar.zst bun-9388b3f8257bc2e580deaece4cd2677928104fc6.zip |
Add a zig fmt action (#2277)
* 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>
Diffstat (limited to 'bench/hot-module-reloading/css-stress-test/read-frames.js')
-rw-r--r-- | bench/hot-module-reloading/css-stress-test/read-frames.js | 24 |
1 files changed, 8 insertions, 16 deletions
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) + "%)", ); |