Skip to content

Commit 862990a

Browse files
committed
Merge branch 'pr/nakrovati/1348-1'
2 parents c1ff026 + dbc61a4 commit 862990a

20 files changed

+34
-72
lines changed

webdriver-ts/src/.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

webdriver-ts/src/benchmarkRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ console.log("benchmarkOptions", benchmarkOptions);
345345
}
346346

347347
main()
348-
.then((_) => {
348+
.then(() => {
349349
console.log("successful run");
350350
process.exit(0);
351351
})

webdriver-ts/src/benchmarksCommon.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BenchmarkOptions, FrameworkData, config } from "./common.js";
1+
import { FrameworkData, config } from "./common.js";
22

33
export enum BenchmarkType {
44
CPU,
@@ -189,19 +189,19 @@ export const memBenchmarkInfosArray: Array<MemBenchmarkInfo> = [
189189
{
190190
id: BENCHMARK_21,
191191
label: "ready memory",
192-
description: (throttleCPU: number|undefined) => "Memory usage after page load.",
192+
description: () => "Memory usage after page load.",
193193
type: BenchmarkType.MEM,
194194
},
195195
{
196196
id: BENCHMARK_22,
197197
label: "run memory",
198-
description: (throttleCPU: number|undefined) => "Memory usage after adding 1,000 rows.",
198+
description: () => "Memory usage after adding 1,000 rows.",
199199
type: BenchmarkType.MEM,
200200
},
201201
{
202202
id: BENCHMARK_23,
203203
label: "update every 10th row for 1k rows (5 cycles)",
204-
description: (throttleCPU: number|undefined) => "Memory usage after clicking update every 10th row 5 times",
204+
description: () => "Memory usage after clicking update every 10th row 5 times",
205205
type: BenchmarkType.MEM,
206206
},
207207
// {
@@ -213,13 +213,13 @@ export const memBenchmarkInfosArray: Array<MemBenchmarkInfo> = [
213213
{
214214
id: BENCHMARK_25,
215215
label: "creating/clearing 1k rows (5 cycles)",
216-
description: (throttleCPU: number|undefined) => "Memory usage after creating and clearing 1000 rows 5 times",
216+
description: () => "Memory usage after creating and clearing 1000 rows 5 times",
217217
type: BenchmarkType.MEM,
218218
},
219219
{
220220
id: BENCHMARK_26,
221221
label: "run memory 10k",
222-
description: (throttleCPU: number|undefined) => "Memory usage after adding 10,000 rows.",
222+
description: () => "Memory usage after adding 10,000 rows.",
223223
type: BenchmarkType.MEM,
224224
}];
225225

@@ -228,7 +228,7 @@ export const startupBenchmarkInfosArray: Array<StartupMainBenchmarkInfo> = [
228228
id: BENCHMARK_30,
229229
type: BenchmarkType.STARTUP_MAIN,
230230
label: '',
231-
description: (throttleCPU: number|undefined) => '',
231+
description: () => '',
232232
},
233233
];
234234

webdriver-ts/src/benchmarksLighthouse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let toKb = (x:number) => x/1024;
1212
export const benchStartupConsistentlyInteractive: StartupBenchmarkInfo = {
1313
id: "31_startup-ci",
1414
label: "consistently interactive",
15-
description: (throttleCPU: number|undefined) => "a pessimistic TTI - when the CPU and network are both definitely very idle. (no more CPU tasks over 50ms)",
15+
description: () => "a pessimistic TTI - when the CPU and network are both definitely very idle. (no more CPU tasks over 50ms)",
1616
property: "interactive",
1717
fn: id,
1818
type: BenchmarkType.STARTUP,
@@ -21,7 +21,7 @@ export const benchStartupConsistentlyInteractive: StartupBenchmarkInfo = {
2121
export const benchStartupBootup: StartupBenchmarkInfo = {
2222
id: "32_startup-bt",
2323
label: "script bootup time",
24-
description: (throttleCPU: number|undefined) => "the total ms required to parse/compile/evaluate all the page's scripts",
24+
description: () => "the total ms required to parse/compile/evaluate all the page's scripts",
2525
property: "bootup-time",
2626
fn: id,
2727
type: BenchmarkType.STARTUP,
@@ -30,7 +30,7 @@ export const benchStartupBootup: StartupBenchmarkInfo = {
3030
export const benchStartupMainThreadWorkCost: StartupBenchmarkInfo = {
3131
id: "33_startup-mainthreadcost",
3232
label: "main thread work cost",
33-
description: (throttleCPU: number|undefined) => "total amount of time spent doing work on the main thread. includes style/layout/etc.",
33+
description: () => "total amount of time spent doing work on the main thread. includes style/layout/etc.",
3434
property: "mainthread-work-breakdown",
3535
fn: id,
3636
type: BenchmarkType.STARTUP,
@@ -39,7 +39,7 @@ export const benchStartupMainThreadWorkCost: StartupBenchmarkInfo = {
3939
export const benchStartupTotalBytes: StartupBenchmarkInfo = {
4040
id: "34_startup-totalbytes",
4141
label: "total kilobyte weight",
42-
description: (throttleCPU: number|undefined) => "network transfer cost (post-compression) of all the resources loaded into the page.",
42+
description: () => "network transfer cost (post-compression) of all the resources loaded into the page.",
4343
property: "total-byte-weight",
4444
fn: toKb,
4545
type: BenchmarkType.STARTUP,

webdriver-ts/src/benchmarksWebdriverAfterframe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { By, WebDriver, WebElement } from "selenium-webdriver";
1+
import { WebDriver, WebElement } from "selenium-webdriver";
22
import * as benchmarksCommon from "./benchmarksCommon.js";
33
import { BenchmarkType } from "./benchmarksCommon.js";
44
import { config, FrameworkData } from "./common.js";
@@ -7,7 +7,7 @@ import {
77
clickElementByXPath,
88
findById,
99
findByXPath,
10-
getTextByXPath, mainRoot, retry, testClassContains, testElementLocatedById, testElementLocatedByXpath,
10+
getTextByXPath, testClassContains, testElementLocatedById, testElementLocatedByXpath,
1111
testElementNotLocatedByXPath, testTextContains
1212
} from "./webdriverAccess.js";
1313

webdriver-ts/src/common.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,8 @@ export interface FrameworkData {
9494
frameworkHomeURL: string;
9595
}
9696

97-
interface Options {
98-
uri: string;
99-
useShadowRoot?: boolean;
100-
}
101-
10297
type KeyedType = "keyed" | "non-keyed";
10398

104-
function computeHash(keyedType: KeyedType, directory: string) {
105-
return keyedType + "/" + directory;
106-
}
107-
10899
export interface FrameworkInformation {
109100
type: KeyedType;
110101
directory: string;
@@ -123,7 +114,7 @@ export interface IMatchPredicate {
123114
(frameworkDirectory: string): boolean;
124115
}
125116

126-
const matchAll: IMatchPredicate = (frameworkDirectory: string) => true;
117+
const matchAll: IMatchPredicate = () => true;
127118

128119
export async function initializeFrameworks(benchmarkOptions: BenchmarkOptions, matchPredicate: IMatchPredicate = matchAll): Promise<FrameworkData[]> {
129120
let lsResult ;

webdriver-ts/src/createIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fs from "fs";
2-
import { BenchmarkOptions, JSONResult, config, initializeFrameworks } from "./common.js";
2+
import { BenchmarkOptions, config, initializeFrameworks } from "./common.js";
33
import * as dot from "dot";
44

55
let benchmarkOptions: BenchmarkOptions = {

webdriver-ts/src/createResultJS.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from "fs";
22
import yargs from "yargs";
33
import { BenchmarkInfo, benchmarkInfos, BenchmarkType, fileName, slowDownFactor } from "./benchmarksCommon.js";
44
import { subbenchmarks } from "./benchmarksLighthouse.js";
5-
import { BenchmarkOptions, config, initializeFrameworks, JSONResult, JSONResultData } from "./common.js";
5+
import { BenchmarkOptions, config, initializeFrameworks, JSONResult } from "./common.js";
66

77
let args: any = yargs(process.argv)
88
.usage(
@@ -37,14 +37,12 @@ let resultsDirectory = args.browser ? "./results_client_"+args.browser : "./resu
3737
async function main() {
3838
let frameworks = await initializeFrameworks(benchmarkOptions);
3939

40-
let results: Map<string, Map<string, JSONResult>> = new Map();
41-
4240
let resultJS = "import {RawResult} from './Common';\n\nexport const results: RawResult[]=[";
4341

4442
let allBenchmarks: Array<BenchmarkInfo> = [];
4543
let jsonResult: { framework: string; benchmark: string; values: {[key:string]: number[]} }[] = [];
4644

47-
benchmarkInfos.forEach((benchmarkInfo, bIdx) => {
45+
benchmarkInfos.forEach((benchmarkInfo) => {
4846
if (args.browser) {
4947
if (benchmarkInfo.type == BenchmarkType.CPU) {
5048
allBenchmarks.push(benchmarkInfo);
@@ -58,7 +56,7 @@ async function main() {
5856
}
5957
});
6058

61-
frameworks.forEach((framework, fIdx) => {
59+
frameworks.forEach((framework) => {
6260
allBenchmarks.forEach((benchmarkInfo) => {
6361
if (!args.browser || framework.keyed) {
6462
let name = `${fileName(framework, benchmarkInfo)}`;

webdriver-ts/src/forkedBenchmarkRunnerPlaywright.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function convertError(error: any): string {
4646
}
4747
}
4848

49+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4950
async function forceGC(page: Page, client: CDPSession) {
5051
for (let i=0;i<7;i++) {
5152
// await client.send('HeapProfiler.collectGarbage');

webdriver-ts/src/forkedBenchmarkRunnerPuppeteer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function convertError(error: any): string {
4343
}
4444
}
4545

46+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4647
async function forceGC(page: Page, client: CDPSession) {
4748
for (let i=0;i<7;i++) {
4849
// await client.send('HeapProfiler.collectGarbage');

0 commit comments

Comments
 (0)