Skip to content

Commit

Permalink
update bench
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-thomas committed Jan 20, 2024
1 parent db41a39 commit 561f219
Show file tree
Hide file tree
Showing 18 changed files with 161 additions and 164 deletions.
18 changes: 11 additions & 7 deletions bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,20 @@ window.onload = function(){

if(queue.length){

const lib = Object.keys(suite)[0];
setTimeout(function(){

for(let i = 0, item; i < queue.length; i++){
const lib = Object.keys(suite)[0];

item = queue[i];
item.fn || (item.fn = suite[lib]);
item.test || (item.test = suite[lib]);
}
for(let i = 0, item; i < queue.length; i++){

item = queue[i];
item.fn || (item.fn = suite[lib]);
item.test || (item.test = suite[lib]);
}

perform();

setTimeout(perform, 200);
}, 200);
}
};

Expand Down
11 changes: 1 addition & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ <h1>Benchmark: Template Rendering Engines</h1>
<ul>
<li><u>Recycle</u>:<sup>*</sup> No restrictions. Everything is allowed, e.g. the re-usage of DOM elements.</li>
<li><u>Keyed</u>:<sup>*</sup> The re-usage of DOM elements is just allowed on data entries sharing the same key.</li>
<li><u>Data-Driven</u>:<sup> </sup> No restrictions. Does not apply de-referencing to the test data.</li>
<!--<li><u>Strict</u>:<sup> </sup> Any kind of recycle (e.g. keyed recycling) is disallowed. Uses infinite random data.</li>-->
<li><u>Data-Driven</u>:<sup> </sup> NRestrictions like keyed, but does not apply de-referencing to the test data.</li>
</ul>
<sup>*</sup> The test applies de-referencing to mimic real incoming data from a server. No fake allowed.
<br><br>
Expand All @@ -179,14 +178,6 @@ <h1>Benchmark: Template Rendering Engines</h1>
<br><br>
The test by default just measure the time it takes to construct and transfer the whole render task to the browser. A library is able to optimize just this specific part. When enabling the option "Force reflow" the benchmark will also measure the time taken by the recalculation (by forcing reflow at the end of each test cycle). Since this part couldn't be optimized by a library it adds way too much unrelated workload to the test and will drastically reduce the potential of getting meaningful results.
</p><br>
<!--
<b>Test Data:</b>
<p>
Before every test is running 5 slots each including 100 unique data items are created. Imagine a paginated table on which you move 5 steps forward, every page has 100 rows.
The test data isn't infinite, because the benchmark has to cover the library optimizations capabilities. Some important capabilities are getting lost when using infinite random data. Let's take the "keyed" recycle strategy as an example. When a key will never match, the whole strategy will negate every improvement and becomes useless.
Also, it doesn't match real world scenario when a test runs 5 seconds and is applying more than 2 million of unique data entries.
</p><br>
-->
<b>Results:</b>
<p>
The result values are based on average, not median. Using median is widely used, but the truth is median timing results effectively cuts out the garbage collector and leads into false results. The <b>index</b> is a stable statistic rank with a maximum possible value of 100, that requires a library to be the best in each test category (regardless how much better). The <b>score</b> value is based on median factorization (apply median on average results is fine), here a score of 100 represents the statistical midfield.
Expand Down
3 changes: 2 additions & 1 deletion test/doohtml/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ <h1>Benchmark: doohtml (non-keyed)</h1><hr>
class Main extends Doo {
constructor(){

super()
super(100);
this.defaultDataSet = "rows";
this.data = {
[this.defaultDataSet]: []
};

suite["doohtml"] = this.render.bind(this);
}

Expand Down
3 changes: 2 additions & 1 deletion test/doohtml/internal.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ <h1>Benchmark: doohtml (non-keyed)</h1><hr>
class Main extends Doo {
constructor(){

super()
super(100);
this.defaultDataSet = "rows";
this.data = {
[this.defaultDataSet]: store([])
};

suite["doohtml"] = this.render.bind(this);
}

Expand Down
3 changes: 2 additions & 1 deletion test/doohtml/keyed.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ <h1>Benchmark: doohtml (non-keyed)</h1><hr>
class Main extends Doo {
constructor(){

super()
super(100);
this.defaultDataSet = "rows";
this.data = {
[this.defaultDataSet]: []
};

suite["doohtml"] = this.render.bind(this);
}

Expand Down
100 changes: 51 additions & 49 deletions test/mikado-proxy/dist/mikado.bundle.module.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion test/mikado-proxy/internal.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ <h1>Benchmark: mikado-proxy-0.8.117 (internal data)</h1><hr>
const mikado = new Mikado(template, {
observe: store(new Mikado.Array()),
mount: root,
recycle: false,
cache: true,
pool: 100
});
Expand Down
1 change: 0 additions & 1 deletion test/mikado-proxy/keyed.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ <h1>Benchmark: mikado-proxy-0.8.117 (keyed)</h1><hr>
const mikado = new Mikado(template, {
observe: store(new Mikado.Array()),
mount: root,
recycle: true,
cache: true,
pool: 100
});
Expand Down
2 changes: 1 addition & 1 deletion test/mikado-proxy/template/keyed.es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/mikado-proxy/template/proxy.es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/mikado-proxy/template/template.es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 561f219

Please sign in to comment.