Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler committed Sep 25, 2024
1 parent c65513c commit c93d109
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions perf/efps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ const formatPercentage = (delta: number): string => {

// For markdown formatting without colors
const formatFpsPlain = (fps: number) => {
if (fps >= 100) return '99.9+'
const rounded = fps.toFixed(1)
return rounded
}

const formatPercentagePlain = (value: number): string => {
const rounded = value.toFixed(1)
const sign = value >= 0 ? '+' : ''
const formatPercentagePlain = (delta: number): string => {
const percentage = delta * 100
const rounded = percentage.toFixed(1)
const sign = delta >= 0 ? '+' : ''
return `${sign}${rounded}%`
}

Expand All @@ -122,9 +124,6 @@ const testOutput: Array<{
for (let i = 0; i < tests.length; i++) {
const test = tests[i]

// Run with local 'sanity' package
// [RUNS] [ singleString ] [local] [latest] [...]
//
const localResults = await runTest({
prefix: `Running test '${test.name}' [${i + 1}/${tests.length}] with local 'sanity'…`,
test,
Expand All @@ -150,7 +149,7 @@ for (let i = 0; i < tests.length; i++) {

const combinedResults = localResults.map((localResult, index) => {
const baseResult = baseResults[index]
const delta = (baseResult.p50 - localResult.p50) / baseResult.p50
const delta = (localResult.p50 - baseResult.p50) / baseResult.p50
return {
...localResult,
delta,
Expand Down Expand Up @@ -182,8 +181,6 @@ for (const {name, results} of testOutput) {

const allPassed = testOutput.flatMap((i) => i.results).every((i) => i.passed)

// const markdownRows: string[] = []

console.log(table.toString())
console.log(`
${chalk.bold('Lowest eFPS:')} ${formatFps(p50Min.p50)}`)
Expand All @@ -200,10 +197,6 @@ console.log(`
│ Tests are failed when any of the median eFPS results perform more than 10% worse.
`)

// Map overallStatus to status text
// const statusText = overallStatus === 'error' ? 'Error' : 'Passed'
// const statusEmoji = getStatusEmoji(overallStatus)

const markdownRows = testOutput
.flatMap((test) =>
test.results.map((result) => ({
Expand Down

0 comments on commit c93d109

Please sign in to comment.