Skip to content

Commit

Permalink
update description
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-thomas committed Jan 20, 2024
1 parent 2d6fc56 commit a99e6ab
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ <h1>Benchmark: Template Rendering Engines</h1>
-->
<b>Results:</b>
<p>
The <b>index</b> is a 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, here a score of 100 represents the statistical midfield.
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.
</p>
<iframe id="iframe"></iframe>
<script src="test/mikado/dist/mikado.bundle.min.js"></script>
Expand Down
17 changes: 12 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,18 @@

length[x]++;

if(/*(test[y] === "size") ||*/ (test[y] === "memory")){
if(test[y] === "memory"){

// median on timing results will cut out garbage collector and will lead into false results!
// here median is applied on average results, that's fine
score[x] += Math.sqrt(median(val[y]) / current[x][test[y]]);
index[x] += Math.sqrt(max[y] / current[x][test[y]]);
current[x]["color_" + test[y]] = color(Math.sqrt(max[y]), Math.sqrt(current[x][test[y]]));
}
else{

// median on timing results will cut out garbage collector and will lead into false results!
// here median is applied on average results, that's fine
score[x] += (current[x][test[y]] / median(val[y]));
index[x] += (current[x][test[y]] / max[y]);
current[x]["color_" + test[y]] = color(current[x][test[y]], max[y]);
Expand Down Expand Up @@ -359,8 +363,7 @@
);
}

/*
function average(arr){
function sum(arr){

const length = arr.length;
let sum = 0;
Expand All @@ -370,8 +373,12 @@
sum += arr[i];
}

return sum / length;
return sum;
}

function average(arr){

return sum(arr) / arr.length;
}
*/

}());
6 changes: 3 additions & 3 deletions test/mikado-proxy/dist/mikado.bundle.module.min.js

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

6 changes: 3 additions & 3 deletions test/mikado-shadow/dist/mikado.light.module.min.js

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

6 changes: 3 additions & 3 deletions test/mikado/dist/mikado.bundle.min.js

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

6 changes: 3 additions & 3 deletions test/mikado/dist/mikado.light.module.min.js

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

0 comments on commit a99e6ab

Please sign in to comment.