Skip to content

Commit 8442e69

Browse files
committed
Code cleanup and further performance improvement.
I think I have exhausted my current ideas for improvement. It looks good from here.
1 parent 1d842e8 commit 8442e69

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

frameworks/keyed/vanillajs-3/src/Main.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
"use strict";
22

3-
new class App {
3+
const gAdjectives = ["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"];
4+
const gColours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"];
5+
const gNouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"];
6+
const nts = {1000: 10, 10000: 125};
7+
8+
new class {
49
index = 1; data = []; labels = null; invalidLabels = true;
510
tbody = document.getElementsByTagName('tbody')[0];
611
constructor() {
@@ -12,15 +17,12 @@ new class App {
1217
run(n = 1000) { if (this.data.length) this.clear(); this.add(n); };
1318
runlots() { this.run(10000) };
1419
add(n = 1000) {
15-
const 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"];
16-
const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"];
17-
const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"];
18-
const l1 = adjectives.length, l2 = colours.length,l3 = nouns.length;
19-
20-
const nt = 125; // n / 25; // Math.round(n / 50);
20+
const adjectives = gAdjectives, colours = gColours, nouns = gNouns;
21+
const l1 = adjectives.length, l2 = colours.length, l3 = nouns.length;
22+
const nt = nts[n];
2123
let i, j = 0, r1, r2, r3;;
2224

23-
const itemTemplates = document.getElementById('itemTemplate').content.cloneNode(true); // .content; // .cloneNode(true);
25+
const itemTemplates = document.getElementById('itemTemplate').content.cloneNode(true);
2426
if (itemTemplates.children.length < nt) {
2527
const itemTemplate = itemTemplates.firstElementChild;
2628
while (nt >= itemTemplates.children.length * 2) itemTemplates.appendChild(itemTemplates.cloneNode(true));
@@ -46,7 +48,6 @@ new class App {
4648
let i; for (i = 0; i < length; i += 10) labels[i].firstChild.nodeValue = data[i] += ' !!!';
4749
};
4850
clear() { this.tbody.textContent = ''; this.data = []; this.invalidLabels = true; };
49-
5051
swaprows() {
5152
const tbody = this.tbody, data = this.data;
5253
if (tbody.children.length < 999) return; this.invalidLabels = true;

webdriver-ts-results/src/results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const results: RawResult[]=[
135135
{"f":131,"b":[{"b":0,"v":{"total":[100.6,102,101,102.4,99.4,103.3,95.8,99.9,102.4,103.9,105.3,100.6,101.1,97.3,103.2],"script":[6.2,6.1,6.2,6.1,6.5,6.2,6.2,6.3,6.4,6.2,6.2,6.7,6.2,6.6,6.8],"paint":[93.2,94.6,93.4,95,91.7,95.4,88.4,92.4,94.3,95.9,97.5,92.8,93.5,89.5,95.1]}},{"b":1,"v":{"total":[114.9,113.9,109,114.7,109.9,108.6,107.8,111.2,111.2,110.7,106.7,108.5,112.3,108.5,113.2],"script":[13.3,13.7,14.1,13,12.6,13.1,12.7,12.8,12.6,13.3,12.5,13.2,13.7,13.4,13.8],"paint":[100.3,98.4,93.7,100,96,94,93.8,97.1,97.4,96.1,92.9,93.9,97,93.7,98.2]}},{"b":2,"v":{"total":[65.3,67.6,69.2,71.9,66.8,69.3,64.9,69.9,69.2,68,64.7,65.4,61.6,52.8,63.8],"script":[1.5,2,1.6,1.9,1.9,1.6,1.9,2.2,2.3,2.3,2.1,1.8,1.7,1.4,2.4],"paint":[57.3,58,61.1,63.8,58.6,62.5,57.7,60.7,60.9,60,57.1,57,53.9,47.5,54.7]}},{"b":3,"v":{"total":[11.6,10.2,11.4,10.7,12.6,9.7,10.9,10.6,8.9,10.1,9.3,11.6,15.2,10.5,10.4,9.3,11,9.3,12,8.9,11.2,13.1,12.5,9.9,10.1],"script":[0.8,0.9,1.3,0.8,0.9,0.8,0.8,0.9,0.5,0.9,0.7,0.8,1,0.8,1.3,1,1.3,1,0.8,0.6,0.9,0.8,1.1,1.2,0.9],"paint":[9,7.2,7.8,8.5,10.1,7.5,8.1,8.3,7.5,7.4,6,8.9,12.1,7.1,7.9,6.3,8,6.1,9.7,7.4,8.4,10.3,9,6.8,7.4]}},{"b":4,"v":{"total":[64,69.2,67.3,64.8,71,68.2,70.9,68.3,68.7,70,69.1,72.3,68.6,74,73.4],"script":[0.5,0.8,0.1,0.7,0.8,0.2,1,0.2,1.2,0.5,1.1,0.7,0.6,0.9,1.1],"paint":[57.7,62.8,62,58,65.1,62.8,64.4,63.3,61.3,64.2,62.8,65.6,62.3,67,66.5]}},{"b":5,"v":{"total":[54.1,57,56.2,55.7,52.9,53.2,52.5,62.1,52.8,54.8,57.9,55.2,57.1,53.3,57.7],"script":[0.7,0.6,0.8,1,0.8,0.8,1,0.7,0.9,0.9,0.8,1,0.8,0.8,1],"paint":[49.9,53.2,51.7,51.5,49.2,48.7,48.5,57.7,48.4,50.9,53.4,51.1,52.8,49.3,53.1]}},{"b":6,"v":{"total":[1185.8,1203.3,1167.5,1154.9,1177,1177.5,1195.3,1168.6,1165.5,1170.1,1176.8,1186,1167.6,1183.7,1177.9],"script":[86.3,90.7,86.1,86.5,82.7,86.6,87,87.5,87.2,89.5,86.2,89.9,88.2,91.7,90],"paint":[1084,1096.9,1065.3,1053,1078.3,1075.8,1093.6,1066.1,1059.8,1062.4,1074,1079,1064.6,1074.4,1071.8]}},{"b":7,"v":{"total":[123.2,113.9,115.5,116.3,118.1,123.8,118.8,122,125.2,122.9,125.1,120.5,119.2,118.9,120.9],"script":[6.5,6.8,6.8,7,6.5,6.7,6.3,6.6,8.1,6.4,6.4,6.5,6.3,6.4,6.7],"paint":[113.3,104.9,106.6,107.2,109.4,113.1,110,112.4,114.7,113.4,115.2,111.5,110.4,110,110.8]}},{"b":8,"v":{"total":[38.2,37.4,36.3,37,35.3,37.9,37,37.7,38.6,36.7,37.4,38,35.9,39.6,33.7],"script":[34.3,32.8,32.2,32.5,31.3,33.9,32.7,33,34.3,32,32.9,33.4,31.7,35.3,29.4],"paint":[2.5,3.3,2.3,2.5,2.7,3.1,3.3,3.2,3.4,3.7,2.8,2.9,3.6,3.4,3.1]}},{"b":9,"v":{"DEFAULT":[0.4]}},{"b":10,"v":{"DEFAULT":[1.9]}},{"b":11,"v":{"DEFAULT":[1.8]}},{"b":12,"v":{"DEFAULT":[0.5]}},{"b":13,"v":{"DEFAULT":[13.7]}},{"b":14,"v":{"DEFAULT":[11.3]}},{"b":15,"v":{"DEFAULT":[2.5]}},{"b":16,"v":{"DEFAULT":[84.3]}}]},
136136
{"f":132,"b":[]},
137137
{"f":133,"b":[]},
138-
{"f":134,"b":[{"b":0,"v":{"total":[103.1,101,101.9,103.7,104.2,101.5,102,102.4,101.7,103.4,102.2,104.9,105.5,103,100.6],"script":[4.3,4.5,4.3,4.3,4.4,4.4,4.4,4.4,4.4,4.4,4.3,4.4,4.5,4.4,4.4],"paint":[97.2,95,95.9,97.7,98.3,95.6,95.8,96.4,95.8,97.4,96.1,99.1,99.2,97.1,95]}},{"b":1,"v":{"total":[109.5,114.3,110.4,109,109.1,111.4,115.7,110.2,111.2,110.4,112.6,109.4,112,108.9,116],"script":[11.3,11.7,12,11.9,11.5,11.8,11.5,12.3,11.7,11.6,11.3,11.7,12,11.8,11.3],"paint":[96.5,101.2,97,95.3,96.4,97.9,102.4,96.2,97.7,96.9,99.5,96,98.3,95.5,102.3]}},{"b":2,"v":{"total":[67.6,67.8,67,58.8,62.8,61.8,66.7,69.1,65.5,60.9,62.3,61.5,59.3,62.4,65.2],"script":[1,0.9,1.5,1,1.5,1.2,1.4,1.1,1.8,0.9,1.5,1.3,0.8,1.2,1.8],"paint":[60.8,61,59.5,51.6,55.9,56,59.1,61.4,58.2,55.5,55.6,54.9,52.9,55.2,56.4]}},{"b":3,"v":{"total":[8.4,7.8,9.5,9.1,8.4,9.8,10.9,8.6,8.4,7.6,8.8,8.8,9.1,10.5,9.1,7.7,9.3,7.8,8.3,8.3,11.1,7.5,8.2,8.5,10.3],"script":[0.5,0.3,0.1,0.4,0.5,0.5,0.8,0.2,0.2,0.5,0.1,0.6,0.1,0.1,0.5,0.5,0.4,0.5,0.7,0.1,0.7,0.6,0.5,0.1,0.1],"paint":[6.9,6.6,7.1,6.7,6.6,7.8,8.7,7.4,6.9,6,7.2,6.8,8.2,8.3,7.3,6.3,7.5,5.1,6,7.8,8.5,5.8,6.8,5.4,8.6]}},{"b":4,"v":{"total":[67.4,65.1,68.6,72.8,67.5,68.3,68.3,76,74.7,68.2,66.4,74.1,69.4,67.5,71.5],"script":[1.5,0.5,1.3,1.2,0.9,0.8,1.2,1,1.1,0.9,0.6,0.8,0.9,1.2,0.8],"paint":[60.3,59.2,62.5,64.9,61.5,61.7,61.5,67.8,68,62.4,59.8,67.7,63.2,59.9,64.8]}},{"b":5,"v":{"total":[57.4,56.1,55.6,57.1,55.9,55,57.3,56.8,53,55.2,56.4,57.6,55.3,53.2,55.5],"script":[0.4,0.5,0.5,0.4,0.4,0.5,0.5,0.3,0.5,0.3,0.3,0.5,0.3,0.3,0.5],"paint":[53.6,51.7,51.4,53.7,52.3,51.5,54,53.5,49.8,51.9,53,53.7,51.5,49.6,51.9]}},{"b":6,"v":{"total":[1156.7,1148.2,1178.2,1158.7,1175.1,1148.6,1131,1148.8,1138.9,1147.3,1131.6,1140.4,1157.5,1165.2,1151.4],"script":[44.7,45.8,44,43.9,45.3,44.5,44.2,45.1,46.1,45.1,45.1,45.3,44.8,46.1,44.5],"paint":[1094.6,1087.1,1116.3,1096.9,1112.6,1088.4,1071.3,1085.9,1077.3,1083.9,1070,1079.3,1094.8,1101.4,1090.8]}},{"b":7,"v":{"total":[120.2,121.8,115.8,114.3,115.7,111.7,118.3,120.5,124.8,119.1,116.4,119.8,115.2,120.4,117.3],"script":[4.5,4.3,4.3,4.3,4.3,4.3,4.4,4.4,4.3,4.3,4.4,4.3,4.3,4.3,4.3],"paint":[113.2,114.6,109.2,107.6,108.8,105.2,111.5,112.9,117.9,112.4,109.5,112.3,108.6,113.1,109.8]}},{"b":8,"v":{"total":[38,36.7,33.5,37.8,36.3,39.8,38.7,37.5,37.1,39.3,37.5,35.7,36.9,36.8,37.1],"script":[32.3,32.1,29.1,33.9,31.5,34.7,34.2,32.5,33.2,34.9,32.9,31,32.1,32.5,32.9],"paint":[3.8,3.7,1.9,2.7,4,3.5,3.8,3.8,2.5,2,2.8,2.7,3.7,3,3.2]}},{"b":9,"v":{"DEFAULT":[0.4]}},{"b":10,"v":{"DEFAULT":[1.7]}},{"b":11,"v":{"DEFAULT":[1.7]}},{"b":12,"v":{"DEFAULT":[0.5]}},{"b":13,"v":{"DEFAULT":[12.8]}},{"b":14,"v":{"DEFAULT":[7.4]}},{"b":15,"v":{"DEFAULT":[1.7]}},{"b":16,"v":{"DEFAULT":[86.3]}}]},
138+
{"f":134,"b":[{"b":0,"v":{"total":[101.8,100.8,100.6,99.2,103,101.3,102.1,101.1,103,103.5,100.1,101.6,100.1,103.2,100.6],"script":[4.2,4.1,4,4.1,4.1,4.1,4.1,4.1,4,4,4.1,4.1,4.1,4.1,4.2],"paint":[95.8,95.1,95,93.4,97.1,95.6,96.5,95.3,97.2,97.8,94.3,95.9,94.3,97.4,94.7]}},{"b":1,"v":{"total":[112.7,111.6,109.7,110.7,110.6,114.1,110.2,107.4,107.8,111.5,110.7,109,109.2,109.7,112.4],"script":[11.5,11.2,11.8,11.2,11.6,11.6,11.3,10.7,11.5,11.4,11.6,11.5,11.5,11.7,11.7],"paint":[99.6,98.7,96.2,97.9,97.3,100.8,97.3,95.1,94.6,98.5,97.3,95.7,96.2,96.2,99.1]}},{"b":2,"v":{"total":[59.5,65.8,60.8,62.9,58.8,58.8,67.1,59.4,57.8,57.6,62.2,58.7,57.5,58.6,57.4],"script":[1.8,1.2,1.3,1.3,0.9,1.5,2,0.8,1.7,1.6,1.4,1.2,1.2,1.5,1.4],"paint":[53.3,57.1,54.8,56.6,52.6,52.1,58.9,53,51.1,50.7,54.7,52.6,51.9,52.6,50.4]}},{"b":3,"v":{"total":[8.1,8.9,7.7,8.1,8.1,7.6,9.5,8.4,8.2,8.7,8.6,8.6,8.3,8.2,6.9,8.2,7.8,7.5,7.7,8,10.8,8.2,8.1,9.1,8.4],"script":[0.1,0.1,0.4,0.5,0.4,0.1,0.1,0.3,0.1,0.1,0.1,0.1,0.7,0.4,0.7,0.7,0.5,0.1,0.5,0.1,0.7,0.2,0.1,0.7,0.9],"paint":[7.1,7.5,6.7,6.8,5.5,6.4,6,7.1,6.3,7.5,7.2,6.2,6.5,7,4.4,6.5,5.8,5.7,5.8,7,8.8,6.7,5.6,7.5,5.9]}},{"b":4,"v":{"total":[67.4,67.2,70.8,65.9,66,66,68.8,66.6,70.3,64.6,67,71,68.1,67.1,65.2],"script":[1.5,1,1.3,0.8,0.8,0.6,0.6,1.5,0.6,1.2,1.3,1.5,1.7,0.9,1],"paint":[60.7,60.6,64,59.5,59.9,60.3,63.3,60.8,64.2,58.7,60.5,64.3,61.3,61.2,58.8]}},{"b":5,"v":{"total":[54.7,54.9,45.3,53.9,53.5,56.1,55.1,54.5,53.3,57,55.4,54.6,55.7,56.1,56.4],"script":[0.5,0.3,0.4,0.2,0.3,0.3,0.5,0.5,0.5,0.5,0.2,0.3,0.4,0.5,0.2],"paint":[51.3,51.2,42.2,50.6,50.5,52.5,51.5,51.4,50.3,53.3,51.5,51,51.7,52.4,52.7]}},{"b":6,"v":{"total":[1172.5,1134.6,1123.6,1168.5,1125.5,1145.2,1132.9,1133,1146.6,1133.8,1132.6,1140.9,1156.8,1127.8,1112.5],"script":[44.6,44.2,44.6,44.6,44.1,44.4,44.8,44.5,45.7,44.7,45.3,45.8,44.9,43.8,44.1],"paint":[1112.4,1073.1,1064,1107.8,1065.6,1085.2,1073,1070.9,1086,1072.2,1071.3,1079.4,1096,1068.1,1052.5]}},{"b":7,"v":{"total":[120.9,117,117.8,117.1,123.5,118.5,122.2,116.3,120.7,112.5,112,113.5,118.3,112.5,114],"script":[4.1,4.1,4.1,4.4,4.4,4.1,4.3,4.2,4.3,4.5,4,4,3.9,4.1,4.3],"paint":[113.8,110.6,111.2,110.3,115.5,112.2,114.9,109.8,113.2,105.8,105.7,107.1,112.1,106.1,107.4]}},{"b":8,"v":{"total":[37.1,36,37,39.6,36.7,38.3,36.4,37.4,40.2,38.4,37,39.3,37.5,37.3,37.9],"script":[32.3,31.4,31.9,34.9,31.7,33.9,32.4,32.5,35.6,33.2,33.2,34.7,33.1,31.8,33.1],"paint":[3.2,3.2,3.7,3.4,4,3.5,3.7,4.2,3.2,3.7,1.1,3.2,3.3,4.5,2.9]}},{"b":9,"v":{"DEFAULT":[0.4]}},{"b":10,"v":{"DEFAULT":[1.7]}},{"b":11,"v":{"DEFAULT":[1.7]}},{"b":12,"v":{"DEFAULT":[0.5]}},{"b":13,"v":{"DEFAULT":[12.8]}},{"b":14,"v":{"DEFAULT":[7.4]}},{"b":15,"v":{"DEFAULT":[1.7]}},{"b":16,"v":{"DEFAULT":[94.9]}}]},
139139
{"f":135,"b":[{"b":0,"v":{"total":[100.8,98.8,101.7,101.2,103.3,103.2,102.3,104,98.4,98.6,97.6,97,100.4,98.2,100.4],"script":[4.2,4.1,4.1,4,4.2,4.1,4,4.1,4,4.1,4,4.1,4.1,4.1,4],"paint":[95.1,93.1,96.1,95.9,97.4,97.5,96.6,98.3,92.8,93,91.7,91.7,94.8,92.5,95]}},{"b":1,"v":{"total":[117.7,109.7,111,112.5,112.7,110.1,114.9,110.4,110.5,109.3,111.2,115.4,115,111.3,111.4],"script":[11.3,11.2,11.1,11.7,11.6,11.3,11.7,11.7,11.2,10.9,11.9,11,11.6,11.2,11.8],"paint":[104.8,96.9,98.1,99,99.8,97,101.5,97.2,97.7,96.8,97.7,102.6,101.8,98.2,98.1]}},{"b":2,"v":{"total":[61.7,77,65,60.8,58.7,60.1,61.4,65.1,60.9,63.6,65.1,62.3,66.3,63.3,63.7],"script":[2.3,2.5,2.1,1.7,1.7,2.2,2.4,1.9,1.6,1.6,1.6,1.8,2.3,1.9,1.8],"paint":[53.7,66,56.6,53,51.8,52.9,53.5,56.9,53.7,56.6,58.2,54.5,57.2,55.9,57.3]}},{"b":3,"v":{"total":[9.5,24.6,8.3,9.4,9.5,9,7.8,9.2,9.2,8.7,8.3,8.6,9.6,10.2,7.8,11,9.4,10.4,9.3,8.2,8,8.9,9.3,8.2,7.8],"script":[0.7,0.3,0.1,0.5,0.8,0.7,0.1,0.9,0.6,0.4,0.8,0.1,0.7,0.1,0.1,0.8,0.9,1,0.7,0.1,0.7,0.7,0.6,0.7,0.1],"paint":[7.2,18.6,6.2,6.2,7.4,7,6.8,7.1,7,6.9,6,7.2,6.9,8,6.6,8,7.5,7.9,7.2,6.8,6.2,7,6.8,6.4,6.3]}},{"b":4,"v":{"total":[67,68.1,66.5,75.9,71.9,69.2,68.7,66.1,67.8,66.3,68.4,66.2,68.7,68.9,79.2],"script":[1.4,0.6,1.1,0.8,0.8,0.8,1.4,1,0.8,1,1.1,1,1.4,0.8,0.5],"paint":[60,61,60.3,69.1,65.7,61.5,61.7,59.1,62.2,59.7,62,59.7,62.6,63.5,71.5]}},{"b":5,"v":{"total":[59.9,62,61.5,57.5,63.1,54.6,59.3,58.2,56.9,57.5,60.8,54.5,60.2,54.2,60.7],"script":[0.2,0.4,0.4,0.4,0.5,0.4,0.4,0.5,0.2,0.3,0.4,0.3,0.5,0.4,0.5],"paint":[56.1,58.7,57.9,53.7,59.6,51,55.8,54.5,53.6,54.2,56.9,51,57.2,50.4,57.2]}},{"b":6,"v":{"total":[1136.7,1182.2,1150.8,1152.3,1159.5,1165.4,1156.9,1146,1154.4,1139.4,1154.7,1147.5,1174.5,1162,1130.9],"script":[45.6,45.8,45.3,44.7,45.9,46.7,46.4,45.9,45.5,44.8,46.4,46.1,45.8,45.5,45.8],"paint":[1074.9,1120.2,1087.6,1091.4,1094.6,1101.3,1094.8,1082.9,1092.7,1078.4,1089.9,1085.4,1111.8,1100.3,1068.5]}},{"b":7,"v":{"total":[115.5,111.4,117.5,116.3,115,118.8,120.3,122.7,118.5,118.3,120.2,117.3,117.6,117.2,115.9],"script":[4.1,4.2,4.1,4.1,4.1,4.3,4.2,4.1,4.2,4.2,4.1,4.1,4.1,4.1,4.1],"paint":[108.9,105.2,111.1,109.7,108.6,112.1,113.1,115.5,111.7,111.5,113,110.7,111,110.7,109.4]}},{"b":8,"v":{"total":[34.3,38.9,37.7,40.7,37.9,36.7,38.4,37.1,36.5,39.9,36.8,37.7,36.3,38.2,38.4],"script":[30.4,33.5,33.5,36.3,33.2,32.2,34.1,32.8,31.7,34.9,32.4,32.9,31.8,33.7,33.4],"paint":[3.4,3.5,3.6,3.3,3.3,2.7,3.1,2.9,3.5,2.6,2.1,4.3,2.9,3.1,2.5]}},{"b":9,"v":{"DEFAULT":[0.4]}},{"b":10,"v":{"DEFAULT":[1.7]}},{"b":11,"v":{"DEFAULT":[1.7]}},{"b":12,"v":{"DEFAULT":[0.5]}},{"b":13,"v":{"DEFAULT":[12.9]}},{"b":14,"v":{"DEFAULT":[6.4]}},{"b":15,"v":{"DEFAULT":[1.5]}},{"b":16,"v":{"DEFAULT":[86.9]}}]},
140140
{"f":136,"b":[]},
141141
{"f":137,"b":[]},

0 commit comments

Comments
 (0)