Skip to content

Commit

Permalink
cap fps to 60
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler committed Sep 25, 2024
1 parent 43b3aae commit ea871ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions perf/efps/helpers/measureFpsForInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export async function measureFpsForInput(input: Locator): Promise<EfpsResult> {
return matchingEvent.timestamp - inputEvent.timestamp
})

const p50 = 1000 / calculatePercentile(latencies, 0.5)
const p75 = 1000 / calculatePercentile(latencies, 0.75)
const p90 = 1000 / calculatePercentile(latencies, 0.9)
const p50 = Math.min(1000 / calculatePercentile(latencies, 0.5), 60)
const p75 = Math.min(1000 / calculatePercentile(latencies, 0.75), 60)
const p90 = Math.min(1000 / calculatePercentile(latencies, 0.9), 60)

return {p50, p75, p90, latencies}
}
6 changes: 3 additions & 3 deletions perf/efps/helpers/measureFpsForPte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export async function measureFpsForPte(pteField: Locator): Promise<EfpsResult> {
return matchingEvent.timestamp - inputEvent.timestamp - matchingEvent.textContentProcessingTime
})

const p50 = 1000 / calculatePercentile(latencies, 0.5)
const p75 = 1000 / calculatePercentile(latencies, 0.75)
const p90 = 1000 / calculatePercentile(latencies, 0.9)
const p50 = Math.min(1000 / calculatePercentile(latencies, 0.5), 60)
const p75 = Math.min(1000 / calculatePercentile(latencies, 0.75), 60)
const p90 = Math.min(1000 / calculatePercentile(latencies, 0.9), 60)

return {p50, p75, p90, latencies}
}

0 comments on commit ea871ae

Please sign in to comment.