Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69fcad6

Browse files
committed
Merge branch 'master' of https://github.com/pakastin/js-framework-benchmark into pakastin-master
2 parents 331330e + 2fba321 commit 69fcad6

File tree

15 files changed

+64
-44
lines changed

15 files changed

+64
-44
lines changed
File renamed without changes.

redom-v3.7.0-keyed/package.json renamed to redom-v3.10.1-keyed/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"author": "",
1111
"license": "ISC",
1212
"devDependencies": {
13-
"redom": "~3.7.0",
14-
"rollup": "~0.51.3",
15-
"rollup-plugin-buble": "~0.17.0",
16-
"rollup-plugin-node-resolve": "~3.0.0",
17-
"rollup-plugin-uglify": "~2.0.1"
13+
"redom": "~3.10.1",
14+
"rollup": "~0.54.1",
15+
"rollup-plugin-buble": "~0.18.0",
16+
"rollup-plugin-node-resolve": "~3.0.2",
17+
"rollup-plugin-uglify": "~3.0.0"
1818
}
1919
}

redom-v3.7.0-keyed/src/app.js renamed to redom-v3.10.1-keyed/src/app.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { el, list } from 'redom';
22

3-
const performance = window.performance;
4-
const setTimeout = window.setTimeout;
3+
const { performance, setTimeout } = window;
54

65
let startTime;
76
let lastMeasure;
@@ -129,6 +128,7 @@ export class App {
129128

130129
class Tr {
131130
constructor ({ app, store }) {
131+
this.data = {};
132132
this.app = app;
133133
this.store = store;
134134
this.el = el('tr',
@@ -148,8 +148,11 @@ class Tr {
148148
const { id, label } = data;
149149
const { selected } = this.store;
150150

151-
if (data !== this.data) {
151+
if (id !== this.data.id) {
152152
this.id.textContent = id;
153+
}
154+
155+
if (label !== this.data.label) {
153156
this.label.textContent = label;
154157
}
155158

@@ -159,6 +162,6 @@ class Tr {
159162
this.el.classList.remove('danger');
160163
}
161164

162-
this.data = data;
165+
this.data = { id, label };
163166
}
164167
}
File renamed without changes.

redom-v3.7.0-keyed/src/store.js renamed to redom-v3.10.1-keyed/src/store.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,64 @@ function _random (max) {
77
export class Store {
88
constructor () {
99
this.data = [];
10-
this.selected = undefined;
10+
this.backup = null;
11+
this.selected = null;
1112
this.id = 1;
1213
}
1314
buildData (count = 1000) {
1415
var adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy'];
1516
var colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange'];
1617
var nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard'];
17-
var data = [];
18-
for (var i = 0; i < count; i++) { data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + ' ' + colours[_random(colours.length)] + ' ' + nouns[_random(nouns.length)] }); }
18+
var data = new Array(1000);
19+
for (var i = 0; i < count; i++) {
20+
data[i] = {
21+
id: this.id++,
22+
label: adjectives[_random(adjectives.length)] + ' ' + colours[_random(colours.length)] + ' ' + nouns[_random(nouns.length)]
23+
};
24+
}
1925
return data;
2026
}
2127
updateData (mod = 10) {
2228
for (let i = 0; i < this.data.length; i += 10) {
23-
this.data[i] = Object.assign({}, this.data[i], {label: this.data[i].label + ' !!!'});
29+
this.data[i].label += ' !!!';
2430
}
2531
}
2632
delete (id) {
27-
const idx = this.data.findIndex(d => d.id == id);
28-
this.data = this.data.filter((e, i) => i != idx);
29-
return this;
33+
const idx = this.data.findIndex(d => d.id === id);
34+
this.data = this.data.filter((e, i) => i !== idx);
3035
}
3136
run () {
3237
this.data = this.buildData();
33-
this.selected = undefined;
38+
this.selected = null;
3439
}
3540
add () {
3641
this.data = this.data.concat(this.buildData(1000));
42+
this.selected = null;
3743
}
3844
update () {
3945
this.updateData();
46+
this.selected = null;
4047
}
4148
select (id) {
4249
this.selected = id;
4350
}
4451
hideAll () {
4552
this.backup = this.data;
4653
this.data = [];
47-
this.selected = undefined;
54+
this.selected = null;
4855
}
4956
showAll () {
5057
this.data = this.backup;
5158
this.backup = null;
52-
this.selected = undefined;
59+
this.selected = null;
5360
}
5461
runLots () {
5562
this.data = this.buildData(10000);
56-
this.selected = undefined;
63+
this.selected = null;
5764
}
5865
clear () {
5966
this.data = [];
60-
this.selected = undefined;
67+
this.selected = null;
6168
}
6269
swapRows () {
6370
if (this.data.length > 998) {

redom-v3.7.0-non-keyed/package.json renamed to redom-v3.10.1-non-keyed/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"author": "",
1111
"license": "ISC",
1212
"devDependencies": {
13-
"redom": "~3.7.0",
14-
"rollup": "~0.51.3",
15-
"rollup-plugin-buble": "~0.17.0",
16-
"rollup-plugin-node-resolve": "~3.0.0",
17-
"rollup-plugin-uglify": "~2.0.1"
13+
"redom": "~3.10.1",
14+
"rollup": "~0.54.1",
15+
"rollup-plugin-buble": "~0.18.0",
16+
"rollup-plugin-node-resolve": "~3.0.2",
17+
"rollup-plugin-uglify": "~3.0.0"
1818
}
1919
}

redom-v3.7.0-non-keyed/src/app.js renamed to redom-v3.10.1-non-keyed/src/app.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { el, list } from 'redom';
22

3-
const performance = window.performance;
4-
const setTimeout = window.setTimeout;
3+
const { performance, setTimeout } = window.performance;
54

65
let startTime;
76
let lastMeasure;
@@ -129,6 +128,7 @@ export class App {
129128

130129
class Tr {
131130
constructor ({ app, store }) {
131+
this.data = {};
132132
this.app = app;
133133
this.store = store;
134134
this.el = el('tr',
@@ -148,8 +148,11 @@ class Tr {
148148
const { id, label } = data;
149149
const { selected } = this.store;
150150

151-
if (data !== this.data) {
151+
if (id !== this.data.id) {
152152
this.id.textContent = id;
153+
}
154+
155+
if (label !== this.data.label) {
153156
this.label.textContent = label;
154157
}
155158

@@ -159,6 +162,6 @@ class Tr {
159162
this.el.classList.remove('danger');
160163
}
161164

162-
this.data = data;
165+
this.data = { id, label };
163166
}
164167
}

redom-v3.7.0-non-keyed/src/store.js renamed to redom-v3.10.1-non-keyed/src/store.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,64 @@ function _random (max) {
77
export class Store {
88
constructor () {
99
this.data = [];
10-
this.selected = undefined;
10+
this.backup = null;
11+
this.selected = null;
1112
this.id = 1;
1213
}
1314
buildData (count = 1000) {
1415
var adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy'];
1516
var colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange'];
1617
var nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard'];
17-
var data = [];
18-
for (var i = 0; i < count; i++) { data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + ' ' + colours[_random(colours.length)] + ' ' + nouns[_random(nouns.length)] }); }
18+
var data = new Array(1000);
19+
for (var i = 0; i < count; i++) {
20+
data[i] = {
21+
id: this.id++,
22+
label: adjectives[_random(adjectives.length)] + ' ' + colours[_random(colours.length)] + ' ' + nouns[_random(nouns.length)]
23+
};
24+
}
1925
return data;
2026
}
2127
updateData (mod = 10) {
2228
for (let i = 0; i < this.data.length; i += 10) {
23-
this.data[i] = Object.assign({}, this.data[i], {label: this.data[i].label + ' !!!'});
29+
this.data[i].label += ' !!!';
2430
}
2531
}
2632
delete (id) {
27-
const idx = this.data.findIndex(d => d.id == id);
28-
this.data = this.data.filter((e, i) => i != idx);
29-
return this;
33+
const idx = this.data.findIndex(d => d.id === id);
34+
this.data = this.data.filter((e, i) => i !== idx);
3035
}
3136
run () {
3237
this.data = this.buildData();
33-
this.selected = undefined;
38+
this.selected = null;
3439
}
3540
add () {
3641
this.data = this.data.concat(this.buildData(1000));
42+
this.selected = null;
3743
}
3844
update () {
3945
this.updateData();
46+
this.selected = null;
4047
}
4148
select (id) {
4249
this.selected = id;
4350
}
4451
hideAll () {
4552
this.backup = this.data;
4653
this.data = [];
47-
this.selected = undefined;
54+
this.selected = null;
4855
}
4956
showAll () {
5057
this.data = this.backup;
5158
this.backup = null;
52-
this.selected = undefined;
59+
this.selected = null;
5360
}
5461
runLots () {
5562
this.data = this.buildData(10000);
56-
this.selected = undefined;
63+
this.selected = null;
5764
}
5865
clear () {
5966
this.data = [];
60-
this.selected = undefined;
67+
this.selected = null;
6168
}
6269
swapRows () {
6370
if (this.data.length > 998) {

webdriver-ts/src/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export let frameworks = [
100100
f("react-v16.1.0-easy-state-v4.0.1-keyed", true),
101101
f("react-v16.1.0-mobX-v3.3.1-keyed", true),
102102
f("react-v16.1.0-redux-v3.7.2-keyed", true),
103-
f("redom-v3.7.0-keyed", true),
104-
f("redom-v3.7.0-non-keyed", false),
103+
f("redom-v3.10.1-keyed", true),
104+
f("redom-v3.10.1-non-keyed", false),
105105
f("reflex-dom-v0.4-keyed", true, {uri: "reflex-dom-v0.4-keyed/bundled-dist"}),
106106
f("riot-v3.7.4-non-keyed", false),
107107
f("rivets-v0.9.6-non-keyed", false),

0 commit comments

Comments
 (0)