Skip to content

Commit

Permalink
Merge branch 'newtab'
Browse files Browse the repository at this point in the history
  • Loading branch information
krausest committed Nov 7, 2023
2 parents ecc4098 + d36498a commit 2fb058b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 10 additions & 6 deletions webdriver-ts/src/forkedBenchmarkRunnerPuppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ async function runCPUBenchmark(

console.log("benchmarking", framework, benchmark.benchmarkInfo.id);
let browser: Browser = null;
let page: Page = null;
// let page: Page = null;
try {
browser = await startBrowser(benchmarkOptions);
page = await browser.newPage();
// page = await browser.newPage();
// if (config.LOG_DETAILS) {
page.on("console", (msg) => {
for (let i = 0; i < msg.args().length; ++i) console.log(`BROWSER: ${msg.args()[i]}`);
});
// page.on("console", (msg) => {
// for (let i = 0; i < msg.args().length; ++i) console.log(`BROWSER: ${msg.args()[i]}`);
// });
// }
for (let i = 0; i < benchmarkOptions.batchSize; i++) {
const page = await browser.newPage();
page.on("console", (msg) => console.log('BROWSER:', ...msg.args()));
try {
await page.goto(`http://${benchmarkOptions.host}:${benchmarkOptions.port}/${framework.uri}/index.html`, {
waitUntil: "networkidle0",
Expand Down Expand Up @@ -120,12 +122,13 @@ async function runCPUBenchmark(
screenshots: false,
categories: categories,
});
await wait(50);
await forceGC(page, client);
console.log("runBenchmark");
let m1 = await page.metrics();
await runBenchmark(page, benchmark, framework);

await wait(40);
await wait(50);
await page.tracing.stop();
let m2 = await page.metrics();
if (throttleCPU) {
Expand All @@ -142,6 +145,7 @@ async function runCPUBenchmark(
);
console.log("**** resultScript =", resultScript);
if (m2.Timestamp == m1.Timestamp) throw new Error("Page metrics timestamp didn't change");
await page.close();
results.push({ total: result.duration, script: resultScript });
console.log(`duration for ${framework.name} and ${benchmark.benchmarkInfo.id}: ${JSON.stringify(result)}`);
if (result.duration < 0) throw new Error(`duration ${result} < 0`);
Expand Down
14 changes: 7 additions & 7 deletions webdriver-ts/src/parseTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import { computeResultsCPU, parseCPUTrace, PlausibilityCheck } from "./timeline.

async function debugSingle() {
let values = [];
// for (let i = 0; i < 12; i++) {
const trace = `unittests/dojo-v8.0.0-keyed_02_replace1k_0.json`;
for (let i = 0; i < 15; i++) {
const trace = `traces/anansi-v0.14.0-keyed_01_run1k_${i}.json`;
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_${i}.json`;
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_0.jsontraces/1more-v0.1.18-keyed_01_run1k_0.json`;
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_0.json`;
// const trace = `traces/arrowjs-v1.0.0-alpha.9-keyed_07_create10k_0.json`;
// const trace = `traces/better-react-v1.1.3-keyed_04_select1k_1.json`;
// const trace = `traces/1more-v0.1.18-keyed_01_run1k_0.json`;
console.log("analyzing trace", trace);
const cpuTrace = await computeResultsCPU(trace);
console.log(trace, cpuTrace);
values.push(cpuTrace.duration);
console.log("analyzing trace", trace);
const cpuTrace = await computeResultsCPU(trace);
console.log(trace, cpuTrace);
values.push(cpuTrace.duration);
// console.log(trace, await computeResultsJS(cpuTrace, config, trace, DurationMeasurementMode.LAST_PAINT))
// }
}
console.log(values);
}

Expand Down

0 comments on commit 2fb058b

Please sign in to comment.