Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 6, 2024
1 parent 657047d commit 9a8086c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import colors from 'picocolors'
import { exec, getSha } from '../scripts/utils.js'

// Thanks to https://github.com/krausest/js-framework-benchmark (Apache-2.0 license)

const {
values: {
skipLib,
Expand Down Expand Up @@ -64,6 +63,7 @@ const {

const port = +(/** @type {string}*/ (portStr))
const count = +(/** @type {string}*/ (countStr))
const sha = await getSha(true)

if (!skipLib) {
await buildLib()
Expand Down Expand Up @@ -229,16 +229,16 @@ async function doBench(browser, isVapor) {
's',
)
const times = await getTimes()

const result =
/** @type {Record<string, typeof compute>} */
Object.fromEntries(Object.entries(times).map(([k, v]) => [k, compute(v)]))

console.table(result)
writeFile(
`results/benchmark-${await getSha(true)}-${mode}.json`,
await writeFile(
`results/benchmark-${sha}-${mode}.json`,
JSON.stringify(result, undefined, 2),
)
await page.close()
return result

function getTimes() {
Expand Down

0 comments on commit 9a8086c

Please sign in to comment.