Skip to content

Commit 665fc2c

Browse files
committed
measure memory via performance.measureUserAgentSpecificMemory()
1 parent abe4547 commit 665fc2c

24 files changed

+3690
-3462
lines changed

push_results.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/usr/bin/cp webdriver-ts-results/table.html ../krausest.github.io/js-framework-benchmark/current.html
2-
/usr/bin/cp webdriver-ts-results/BoxPlotTable*.js ../krausest.github.io/js-framework-benchmark/
1+
cp webdriver-ts-results/table.html ../krausest.github.io/js-framework-benchmark/current.html
2+
cp webdriver-ts-results/BoxPlotTable*.js ../krausest.github.io/js-framework-benchmark/
33
cd ../krausest.github.io
44
git add js-framework-benchmark/current.html
55
git add js-framework-benchmark/BoxPlotTable*.js

webdriver-ts-results/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"rules": {
2020
"@typescript-eslint/explicit-function-return-type": 0,
2121
"react-hooks/rules-of-hooks": "error",
22-
"react-hooks/exhaustive-deps": "warn"
22+
"react-hooks/exhaustive-deps": "warn",
23+
"no-debugger": "warn"
2324
}
2425
}

webdriver-ts-results/src/App.css

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ select {
3131
.header-row {
3232
margin: 20px 0;
3333
}
34-
.dropdown-container {
35-
display: inline-block;
36-
}
3734
.dropdown-container > .shutter, .dropdown-container > .dropdown-menu {
3835
display: none;
3936
}
@@ -200,6 +197,25 @@ dd {
200197
cursor: pointer;
201198
}
202199

200+
.iconbutton {
201+
border: 1px solid #ccc;
202+
border-radius: 4px;
203+
padding: 2px 2px;
204+
outline: none;
205+
box-shadow: 0px 0px 2px 2px rgb(0 0 0 / 0%);
206+
width: 26px;
207+
}
208+
.iconbutton:active {
209+
border: 1px solid #888;
210+
}
211+
.header-row {
212+
display: flex;
213+
}
214+
.header-row > * {
215+
align-self:center;
216+
}
217+
218+
203219

204220
button:disabled.textButton {
205221
color: #666;

webdriver-ts-results/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const App = () => {
1616
<div>
1717
{disclaimer}
1818
<p>The benchmark was run on a MaBook Air M1 (16 GB RAM, OSX 12.4), Chrome 103.0.5060.53 (arm64))
19-
using the puppeteer benchmark driver with full tracing.
19+
using the playwright benchmark driver with reduced tracing.
2020
</p>
2121
<SelectionBar/>
2222
<ResultTable type={FrameworkType.KEYED}/>

webdriver-ts-results/src/Common.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@ export enum FrameworkType { KEYED, NON_KEYED }
1010

1111
export interface Framework {
1212
name: string;
13+
dir: string;
1314
type: FrameworkType;
1415
issues: number[];
1516
displayname: string;
1617
}
1718

18-
export enum Severity {Error, Categorization}
19+
export enum Severity {Note, Error}
1920

2021
interface Category {
2122
id: number;
2223
text: string;
2324
issues: Array<number>;
25+
severity: Severity;
2426
}
2527

2628
export const categories: Category[] = [
27-
{id:1, text:"[Note]: Manual DOM manipulations", issues: [772]},
28-
{id:2, text:"[Note]:View state on the model", issues: [800]},
29-
{id:3, text:"[Note]: Explicit requestAnimationFrame calls", issues: [796]},
30-
{id:4, text:"[Note]: Manual event delegation", issues: [801]},
31-
{id:5, text:"[Issue]: Errors in the implementation", issues: [634]},
29+
{id:1, text:"[Note]: Manual DOM manipulations", issues: [772], severity: Severity.Note},
30+
{id:2, text:"[Note]:View state on the model", issues: [800], severity: Severity.Note},
31+
{id:3, text:"[Note]: Explicit requestAnimationFrame calls", issues: [796], severity: Severity.Note},
32+
{id:4, text:"[Note]: Manual event delegation", issues: [801], severity: Severity.Note},
33+
{id:5, text:"[Issue]: Errors in the implementation", issues: [634], severity: Severity.Error},
3234
]
3335

3436
export const knownIssues = [
3537
{issue: 634, severity: Severity.Error, text:"[Issue]: The HTML structure for the implementation is not fully correct.", link: "https://github.com/krausest/js-framework-benchmark/issues/634"},
36-
{issue: 772, severity: Severity.Categorization, text:"[Note]: Implementation uses manual DOM manipulations", link: "https://github.com/krausest/js-framework-benchmark/issues/772"},
37-
{issue: 796, severity: Severity.Categorization, text:"[Note]: Implementation uses explicit requestAnimationFrame calls", link: "https://github.com/krausest/js-framework-benchmark/issues/796"},
38-
{issue: 800, severity: Severity.Categorization, text:"[Note]: View state on the model", link: "https://github.com/krausest/js-framework-benchmark/issues/800"},
39-
{issue: 801, severity: Severity.Categorization, text:"[Note]: Implementation uses manual event delegation", link: "https://github.com/krausest/js-framework-benchmark/issues/801"},
38+
{issue: 772, severity: Severity.Note, text:"[Note]: Implementation uses manual DOM manipulations", link: "https://github.com/krausest/js-framework-benchmark/issues/772"},
39+
{issue: 796, severity: Severity.Note, text:"[Note]: Implementation uses explicit requestAnimationFrame calls", link: "https://github.com/krausest/js-framework-benchmark/issues/796"},
40+
{issue: 800, severity: Severity.Note, text:"[Note]: View state on the model", link: "https://github.com/krausest/js-framework-benchmark/issues/800"},
41+
{issue: 801, severity: Severity.Note, text:"[Note]: Implementation uses manual event delegation", link: "https://github.com/krausest/js-framework-benchmark/issues/801"},
4042
];
4143

4244
export function findIssue(issueNumber: number) {

webdriver-ts-results/src/reducer.ts

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Benchmark, BenchmarkType, convertToMap, DisplayMode, Framework, FrameworkType, RawResult, Result, ResultTableData, SORT_BY_GEOMMEAN_CPU, categories } from "./Common"
1+
import { Benchmark, BenchmarkType, convertToMap, DisplayMode, Framework, FrameworkType, RawResult, Result, ResultTableData, SORT_BY_GEOMMEAN_CPU, categories, Severity } from "./Common"
22
import {benchmarks as benchmark_orig, frameworks, results as rawResults} from './results';
33

44
// Temporarily disable script bootup time
@@ -18,7 +18,7 @@ const removeKeyedSuffix = (value: string) => {
1818
else if (value.endsWith('-keyed')) return value.substring(0,value.length-6)
1919
return value;
2020
}
21-
const mappedFrameworks = frameworks.map(f => ({name: f.name, displayname: removeKeyedSuffix(f.name), issues: f.issues ?? [], type:f.keyed ? FrameworkType.KEYED : FrameworkType.NON_KEYED}));
21+
const mappedFrameworks = frameworks.map(f => ({name: f.name, dir: f.dir, displayname: removeKeyedSuffix(f.name), issues: f.issues ?? [], type:f.keyed ? FrameworkType.KEYED : FrameworkType.NON_KEYED}));
2222

2323
const allBenchmarks = benchmarks.reduce((set, b) => set.add(b), new Set<Benchmark>() );
2424
const allFrameworks = mappedFrameworks.reduce((set, f) => set.add(f), new Set<Framework>() );
@@ -84,7 +84,7 @@ const preInitialState: State = {
8484
[FrameworkType.KEYED]: undefined,
8585
[FrameworkType.NON_KEYED]: undefined
8686
},
87-
categories: new Set([1,2,3,4])
87+
categories: new Set(categories.filter(c => c.severity != Severity.Error).map(c => c.id))
8888
}
8989

9090
function updateResultTable({frameworks, benchmarks, selectedFrameworksDropDown: selectedFrameworks, selectedBenchmarks, sortKey, displayMode, compareWith, categories}: State) {
@@ -147,14 +147,55 @@ interface SortAction { type: 'SORT'; data: {sortKey: string}}
147147
export const sort = (sortKey: string): SortAction => {
148148
return {type: 'SORT', data: {sortKey}}
149149
}
150+
151+
interface SetStateFromClipboardAction { type: 'SET_STATE_FROM_CLIPBOARD'; data: any}
152+
export const setStateFromClipboard = (state: any): SetStateFromClipboardAction => {
153+
return {type: 'SET_STATE_FROM_CLIPBOARD', data: {state}}
154+
}
155+
150156
type Action = SelectFrameworkAction | SelectAllFrameworksAction | SelectBenchmarkAction | SelectAllBenchmarksAction
151157
| SelectDisplayModeAction | CompareAction |StopCompareAction | SortAction
152-
| SelectCategoryAction | SelectAllCategoriesAction;
158+
| SelectCategoryAction | SelectAllCategoriesAction | SetStateFromClipboardAction;
153159

154160
// eslint-disable-next-line @typescript-eslint/no-explicit-any
155161
export const reducer = (state = initialState, action: Action): State => {
156162
console.log("reducer", action)
157163
switch (action.type) {
164+
case 'SET_STATE_FROM_CLIPBOARD': {
165+
let t = {...state};
166+
debugger;
167+
if (action.data.state?.benchmarks) {
168+
const newSelectedBenchmarks = new Set<Benchmark>();
169+
for (const b of action.data.state.benchmarks) {
170+
for (const sb of benchmarks) {
171+
if (b === sb.id) newSelectedBenchmarks.add(sb);
172+
}
173+
}
174+
t = {...t, selectedBenchmarks: newSelectedBenchmarks};
175+
}
176+
if (action.data.state?.frameworks) {
177+
const newSelectedFramework = new Set<Framework>();
178+
for (const f of action.data.state.frameworks) {
179+
for (const sf of mappedFrameworks) {
180+
if (f === sf.dir) newSelectedFramework.add(sf);
181+
}
182+
}
183+
t = {...t, selectedFrameworksDropDown: newSelectedFramework};
184+
}
185+
if (action.data.state?.displayMode) {
186+
t = {...t, displayMode: action.data.state.displayMode};
187+
}
188+
if (action.data.state?.categories) {
189+
const newSelectedCategories = new Set<number>();
190+
for (const f of action.data.state?.categories) {
191+
for (const sc of categories) {
192+
if (f === sc.id) newSelectedCategories.add(sc.id);
193+
}
194+
}
195+
t = {...t, categories: newSelectedCategories};
196+
}
197+
return {...t, resultTables: updateResultTable(t)}
198+
}
158199
case 'SELECT_FRAMEWORK': {
159200
const newSelectedFramework = new Set(state.selectedFrameworksDropDown);
160201
if (action.data.add) newSelectedFramework.add(action.data.framework);

0 commit comments

Comments
 (0)