Skip to content

Commit e440ef8

Browse files
committed
Changed module scripts to regular scripts
- module scripts are slower to load. - modified `nTemplates` functions to return `Math.round(n/100)`
1 parent 0984377 commit e440ef8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

frameworks/keyed/vanillajs-3/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<title>Benchmarks for Vanillajs-3</title>
55
<link href="/css/currentStyle.css" rel="stylesheet" />
6-
<script src='src/Main.js' type="module"></script>
76
</head>
87
<body>
98
<div id="main">
@@ -81,5 +80,6 @@ <h1>Vanillajs-3-"keyed"</h1>
8180
</div>
8281
</div>
8382
<template id="itemTemplate"><tr><td class='col-md-1'>{id}</td><td class='col-md-4'><a class='lbl'>{lbl}</a></td><td class='col-md-1'><a class='remove'><span class='remove glyphicon glyphicon-remove' aria-hidden='true'></span></a></td><td class='col-md-6'></td></tr></template>
83+
<script src='src/Main.js'></script>
8484
</body>
8585
</html>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "b
33
const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"];
44
const [l1, l2, l3] = [adjectives.length, colours.length, nouns.length];
55

6-
const nTemplates = (n) => n / 100, tbody = document.getElementsByTagName('tbody')[0];
6+
const nTemplates = (n) => Math.round(n / 100), tbody = document.getElementsByTagName('tbody')[0];
77
let data = [], index = 1, i, lbl, selected;
88

99
function create(n = 1000) { if (tbody.children.length) clear(); append(n); }

frameworks/non-keyed/vanillajs-3/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<title>Benchmarks for Vanillajs-3</title>
55
<link href="/css/currentStyle.css" rel="stylesheet" />
6-
<script src='src/Main.js' type="module"></script>
76
</head>
87
<body>
98
<div id="main">
@@ -81,5 +80,6 @@ <h1>Vanillajs-3-"non-keyed"</h1>
8180
</div>
8281
</div>
8382
<template id="itemTemplate"><tr><td class='col-md-1'>{id}</td><td class='col-md-4'><a class='lbl'>{lbl}</a></td><td class='col-md-1'><a class='remove'><span class='remove glyphicon glyphicon-remove' aria-hidden='true'></span></a></td><td class='col-md-6'></td></tr></template>
83+
<script src='src/Main.js'></script>
8484
</body>
8585
</html>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function* _random(n) {
99
yield arr
1010
}
1111
}
12-
const data = [], nTemplates = (n) => 10, tbody = document.getElementsByTagName('tbody')[0];
12+
const data = [], nTemplates = (n) => Math.round(n / 100), tbody = document.getElementsByTagName('tbody')[0];
1313
let index = 1, i, lbl, selected;
1414

1515
function create(n = 1000) {

0 commit comments

Comments
 (0)