Skip to content

Commit

Permalink
Delete the timer based measurement since we've switched over to (WebK…
Browse files Browse the repository at this point in the history
…it#466)

requestAnimationFrame based measurement for 3.0 and found no issues.
  • Loading branch information
rniwa authored Dec 20, 2024
1 parent f7c3a70 commit d87b307
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
9 changes: 1 addition & 8 deletions resources/developer-mode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function createDeveloperModeContainer() {
const settings = document.createElement("div");
settings.className = "settings";
settings.append(createUIForIterationCount());
settings.append(createUIForMeasurementMethod());
settings.append(createUIForWarmupSuite());
settings.append(createUIForWarmupBeforeSync());
settings.append(createUIForSyncStepDelay());
Expand All @@ -40,12 +39,6 @@ function span(text) {
return span;
}

function createUIForMeasurementMethod() {
return createCheckboxUI("rAF timing", params.measurementMethod === "raf", (isChecked) => {
params.measurementMethod = isChecked ? "raf" : "timer";
});
}

function createUIForWarmupSuite() {
return createCheckboxUI("Use Warmup Suite", params.useWarmupSuite, (isChecked) => {
params.useWarmupSuite = isChecked;
Expand Down Expand Up @@ -262,7 +255,7 @@ function updateURL() {
}
}

const defaultParamKeys = ["measurementMethod", "iterationCount", "useWarmupSuite", "warmupBeforeSync", "waitBeforeSync"];
const defaultParamKeys = ["iterationCount", "useWarmupSuite", "warmupBeforeSync", "waitBeforeSync"];
for (const paramKey of defaultParamKeys) {
if (params[paramKey] !== defaultParams[paramKey])
url.searchParams.set(paramKey, params[paramKey]);
Expand Down
6 changes: 3 additions & 3 deletions resources/shared/params.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Params {
// Change how a test measurement is triggered and async time is measured:
// "timer": The classic (as in Speedometer 2.x) way using setTimeout
// "raf": Using rAF callbacks, both for triggering the sync part and for measuring async time.
measurementMethod = "raf"; // or "timer"
measurementMethod = "raf";
// Wait time before the sync step in ms.
waitBeforeSync = 0;
// Warmup time before the sync step in ms.
Expand Down Expand Up @@ -122,8 +122,8 @@ export class Params {
if (!searchParams.has("measurementMethod"))
return defaultParams.measurementMethod;
const measurementMethod = searchParams.get("measurementMethod");
if (measurementMethod !== "timer" && measurementMethod !== "raf")
throw new Error(`Invalid measurement method: '${measurementMethod}', must be either 'raf' or 'timer'.`);
if (measurementMethod !== "raf")
throw new Error(`Invalid measurement method: '${measurementMethod}', must be 'raf'.`);
searchParams.delete("measurementMethod");
return measurementMethod;
}
Expand Down
18 changes: 0 additions & 18 deletions resources/shared/test-invoker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@ class TestInvoker {
}
}

export class TimerTestInvoker extends TestInvoker {
start() {
return new Promise((resolve) => {
setTimeout(() => {
this._syncCallback();
setTimeout(() => {
this._asyncCallback();
requestAnimationFrame(async () => {
const result = await this._reportCallback();
resolve(result);
});
}, 0);
}, this._params.waitBeforeSync);
});
}
}

export class RAFTestInvoker extends TestInvoker {
start() {
return new Promise((resolve) => {
Expand All @@ -50,6 +33,5 @@ export class RAFTestInvoker extends TestInvoker {

export const TEST_INVOKER_LOOKUP = {
__proto__: null,
timer: TimerTestInvoker,
raf: RAFTestInvoker,
};

0 comments on commit d87b307

Please sign in to comment.