Skip to content

Commit 4d6c8e6

Browse files
committed
cleanup
1 parent 246a077 commit 4d6c8e6

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

webdriver-ts/src/forkedBenchmarkRunnerPlaywright.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async function runCPUBenchmark(framework: FrameworkData, benchmark: CPUBenchmark
120120
console.log("runBenchmark Playwright");
121121
await runBenchmark(browser, page, benchmark, framework);
122122

123-
await wait(4000);
123+
await wait(40);
124124
await browser.stopTracing();
125125
let m2 = (await client.send('Performance.getMetrics')).metrics;
126126
let m2_val = m2.find(m => m.name === 'ScriptDuration').value;

webdriver-ts/src/parseTrace.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@ let benchmarkOptions: BenchmarkOptions = {
2424
allowThrottling: false
2525
};
2626

27-
async function main() {
27+
async function single() {
2828

2929

3030

31-
// for (let i = 0; i < 1; i++) {
32-
const trace = `traces/ui5-webcomponents-v1.3.1-keyed_08_create1k-after1k_x2_2.json`;
31+
for (let i = 0; i < 1; i++) {
32+
// const trace = `traces/1more-v0.1.18-keyed_01_run1k_0.json`;
33+
const trace = `traces/react-hooks-use-transition-v18.2.0-keyed_07_create10k_1.json`;
3334
console.log("analyzing trace ", trace);
3435
const cpuTrace = await computeResultsCPU(config, trace, DurationMeasurementMode.LAST_PAINT);
3536
console.log(trace, cpuTrace)
3637
console.log(trace, await computeResultsJS(cpuTrace, config, trace, DurationMeasurementMode.LAST_PAINT))
37-
// }
38+
}
3839

3940

4041
}
@@ -53,11 +54,11 @@ async function readAll() {
5354
if (!fs.existsSync(trace)) {
5455
console.log("ignoring ", trace, "since it doesn't exist.");
5556
} else {
56-
console.log("checking ", trace, benchmarkInfo.durationMeasurementMode);
57+
// console.log("checking ", trace, benchmarkInfo.durationMeasurementMode);
5758
let result = await computeResultsCPU(config, trace, benchmarkInfo.durationMeasurementMode);
5859
let resultJS = await computeResultsJS(result, config, trace, benchmarkInfo.durationMeasurementMode);
5960
results.push({total:result.duration, script:resultJS});
60-
console.log(result);
61+
// console.log(result);
6162
}
6263
}
6364
results.sort((a: CPUBenchmarkResult, b: CPUBenchmarkResult) => a.total - b.total);
@@ -72,4 +73,4 @@ async function readAll() {
7273
}
7374
}
7475

75-
readAll().catch(err => {console.log("Error in isKeyed", err)});
76+
single().catch(err => {console.log("Error in isKeyed", err)});

webdriver-ts/src/timeline.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ interface Timingresult {
230230
console.log("IGNORING more than one paint due to FIRST_PAINT_AFTER_LAYOUT", fileName, duration);
231231
}
232232
}
233-
console.log("duration", duration);
233+
if (config.LOG_DEBUG) { console.log("duration", duration); }
234234

235235
// let updateLayoutTree = R.filter((e: Timingresult) => e.ts > click.end)(R.filter(type_eq('updateLayoutTree'))(eventsDuringBenchmark));
236236
// console.log("updateLayoutTree", updateLayoutTree.length, updateLayoutTree[0].end);
@@ -279,6 +279,7 @@ interface Timingresult {
279279
ev.ts -= totalDuration.tsStart;
280280
ev.end -= totalDuration.tsStart;
281281
}
282+
console.log("eventsWithin", eventsWithin);
282283
interface Interval {
283284
start: number,
284285
end: number,
@@ -304,7 +305,13 @@ interface Timingresult {
304305
for (let ev of eventsWithin) {
305306
intervals = newContainedInterval(ev, intervals);
306307
}
308+
if (intervals.length > 1) {
309+
console.log(`*** More than 1 interval ${intervals.length} for ${fileName}`, intervals);
310+
} else {
311+
console.log(`1 interval for ${fileName}`, intervals);
312+
}
307313

308-
return intervals.reduce((p,c) => p+(c.end-c.start), 0)/1000.0;
314+
let res = intervals.reduce((p,c) => p+(c.end-c.start), 0)/1000.0;
315+
return res;
309316
}
310317

0 commit comments

Comments
 (0)