Add warmupBeforeSync parameter, which triggers speciefied milliseconds of infinite loop before each sync step. (#196)
This will allow us to evaluate the impact of using rAF vs. timer with regards to CPU throttling.
This commit is contained in:
parent
4f9ffb5e3b
commit
ec51e3188b
2 changed files with 11 additions and 0 deletions
|
|
@ -350,6 +350,10 @@ export class BenchmarkRunner {
|
|||
let asyncStartTime;
|
||||
let asyncTime;
|
||||
const runSync = () => {
|
||||
if (params.warmupBeforeSync) {
|
||||
const startTime = performance.now();
|
||||
while (performance.now() - startTime < params.warmupBeforeSync); // Infinite loop for the specified ms.
|
||||
}
|
||||
performance.mark(startLabel);
|
||||
const syncStartTime = performance.now();
|
||||
test.run(this._page);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ class Params {
|
|||
searchParams.delete("useWarmupSuite");
|
||||
}
|
||||
|
||||
if (searchParams.has("warmupBeforeSync")) {
|
||||
this.warmupBeforeSync = parseInt(searchParams.get("warmupBeforeSync"));
|
||||
if (this.warmupBeforeSync < 1)
|
||||
throw new Error(`Invalid warmupBeforeSync param: ${this.warmupBeforeSync}`);
|
||||
searchParams.delete("warmupBeforeSync");
|
||||
}
|
||||
|
||||
if (searchParams.has("measurementMethod")) {
|
||||
this.measurementMethod = searchParams.get("measurementMethod");
|
||||
if (this.measurementMethod !== "timer" && this.measurementMethod !== "raf")
|
||||
|
|
|
|||
Loading…
Reference in a new issue