Skip to content

Commit 14e1c11

Browse files
committed
Merge branch 'renderDuration'
2 parents b827399 + af7a569 commit 14e1c11

21 files changed

+1844
-1758
lines changed

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default [
7474
"@typescript-eslint/no-explicit-any": "off",
7575
"require-await": "error",
7676
"@typescript-eslint/no-floating-promises": "error",
77+
"@typescript-eslint/no-unused-vars": "off",
7778
},
7879
},
7980
/**
@@ -97,6 +98,7 @@ export default [
9798
languageOptions: { globals: { ...globals.browser, ...globals.node } },
9899
rules: {
99100
"@typescript-eslint/no-loss-of-precision": "off",
101+
"no-debugger":"off"
100102
},
101103
},
102104
];

webdriver-ts-results/src/App.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ select {
2929
background-color: #fafafa;
3030
border-top: 1px solid var(--border-color);
3131
border-bottom: 1px solid var(--border-color);
32-
padding: 20px 0;
33-
flex-direction: column;
34-
display: flex;
35-
gap: 10px;
32+
padding: 10px 0;
33+
line-height: 0;
3634
}
3735
.select-bar__dropdowns {
36+
padding: 5px 0;
3837
display: flex;
3938
flex-direction: row;
4039
gap: 1rem;

webdriver-ts-results/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const App = () => {
6262
</p>
6363

6464
<main>
65-
<SelectionBar showDurationSelection={false} />
65+
<SelectionBar showDurationSelection={true} />
6666
<ResultTable type={FrameworkType.KEYED} />
6767
<ResultTable type={FrameworkType.NON_KEYED} />
6868
<KnownIssuesList></KnownIssuesList>

webdriver-ts-results/src/Common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export enum DisplayMode {
1313
export enum CpuDurationMode {
1414
Total = "total",
1515
Script = "script",
16+
Render = "paint",
17+
BrowserOnly = "browser only",
1618
}
1719

1820
export enum FrameworkType {

webdriver-ts-results/src/components/ResultTable.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,19 @@ const ResultTable = ({ type }: Props) => {
5252
<p>{texts[type].description}</p>
5353

5454
{cpuDurationMode === CpuDurationMode.Script && (
55-
<h3>Warning: This is an experimental view. Don&apos;t rely on those values yet.</h3>
55+
<h3>Warning: This is an experimental view that includes script duration only. Don&apos;t rely on those values yet and don&apos;t report them until they are official.
56+
Report bugs in issue <a href="https://github.com/krausest/js-framework-benchmark/issues/1233">1233</a>.
57+
</h3>
58+
)}
59+
{cpuDurationMode === CpuDurationMode.BrowserOnly && (
60+
<h3>Warning: This is an experimental view that shows the difference between total duration and script duration. Don&apos;t rely on those values yet and don&apos;t report them until they are official.
61+
I guess this view mode just makes no sense.
62+
</h3>
63+
)}
64+
{cpuDurationMode === CpuDurationMode.Render && (
65+
<h3>Warning: This is an experimental view that shows the difference between total duration and script duration. Don&apos;t rely on those values yet and don&apos;t report them until they are official.
66+
Report bugs in issue <a href="https://github.com/krausest/js-framework-benchmark/issues/1233">1233</a>.
67+
</h3>
5668
)}
5769
{displayMode === DisplayMode.BoxPlot ? (
5870
<>

webdriver-ts-results/src/components/selection/ModeSelectionPanel/DurationModeSelector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const DurationModeSelector = ({ cpuDurationMode, onChange }: Props) => {
2222
>
2323
<option value={CpuDurationMode.Total}>total duration</option>
2424
<option value={CpuDurationMode.Script}>only JS duration</option>
25+
<option value={CpuDurationMode.Render}>only render duration</option>
26+
<option value={CpuDurationMode.BrowserOnly}>Browser only duration</option>
2527
</select>
2628
</div>
2729
</>

webdriver-ts-results/src/components/selection/ModeSelectionPanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ const ModeSelecionPanel = ({ showDurationSelection }: Props) => {
2626
onChange={(value) => selectDisplayMode(value)}
2727
/>
2828

29+
</div>
2930
{showDurationSelection ? (
3031
<DurationModeSelector
3132
cpuDurationMode={cpuDurationMode}
3233
onChange={(value) => selectCpuDurationMode(value)}
3334
/>
3435
) : null}
35-
</div>
3636
</>
3737
);
3838
};

webdriver-ts-results/src/components/selection/SelectionBar.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ export const SelectionBar = ({ showDurationSelection }: Props) => {
1212
console.log("SelectionBar");
1313

1414
return (
15-
<div className="select-bar">
16-
<div className="select-bar__dropdowns">
17-
<FrameworkSelector />
18-
<BenchmarkSelector />
15+
<>
16+
<div className="select-bar">
17+
<div className="select-bar__dropdowns">
18+
<FrameworkSelector />
19+
<BenchmarkSelector />
20+
<CopyPasteSelection />
21+
</div>
22+
<div className="select-bar__dropdowns">
23+
<ModeSelecionPanel showDurationSelection={showDurationSelection} />
24+
</div>
1925
</div>
20-
<ModeSelecionPanel showDurationSelection={showDurationSelection} />
21-
<CopyPasteSelection />
22-
</div>
26+
</>
2327
);
2428
};

webdriver-ts-results/src/reducer.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ import {
2020
knownIssues,
2121
} from "./Common";
2222

23-
// OK
2423
const benchmarks = rawBenchmarks.filter(
2524
(benchmark) =>
2625
benchmark.id !== "32_startup-bt" &&
2726
benchmark.id !== "33_startup-mainthreadcost",
2827
);
2928

30-
// OK
3129
const results: Result[] = rawResults.map((result) => {
3230
const values: { [k: string]: ResultValues } = {};
3331
for (const key of Object.keys(result.v)) {
@@ -40,10 +38,26 @@ const results: Result[] = rawResults.map((result) => {
4038
};
4139
values[key] = vals;
4240
}
41+
if (result.v[CpuDurationMode.Total] && result.v[CpuDurationMode.Script] && result.v[CpuDurationMode.Render]) {
42+
if (result.v[CpuDurationMode.Total].length !== result.v[CpuDurationMode.Script].length)
43+
throw "Lengths must match";
44+
let r = [];
45+
for (let i = 0; i < result.v[CpuDurationMode.Total].length; i++) {
46+
r.push(result.v[CpuDurationMode.Total][i] - result.v[CpuDurationMode.Script][i]);
47+
}
48+
const vals = {
49+
mean: jStat.mean(r),
50+
median: jStat.median(r),
51+
standardDeviation: jStat.stdev(r, true),
52+
values: r,
53+
};
54+
// if (result.f==='miso-v1.4.0-keyed' || result.f==='vanillajs-keyed') debugger;
55+
values[CpuDurationMode.BrowserOnly] = vals;
56+
}
57+
4358
return { framework: result.f, benchmark: result.b, results: values };
4459
});
4560

46-
// OK
4761
const removeKeyedSuffix = (value: string) => {
4862
if (value.endsWith("-non-keyed"))
4963
return value.substring(0, value.length - 10);
@@ -52,7 +66,6 @@ const removeKeyedSuffix = (value: string) => {
5266
return value;
5367
};
5468

55-
// OK
5669
const mappedFrameworks = frameworks.map((f) => ({
5770
name: f.name,
5871
dir: f.dir,

0 commit comments

Comments
 (0)