Browse files

Stats improved

  • Loading branch information...
1 parent c2890bf commit 9d34d9aac331f352cd2e5606e91c38cf4695e59f @penartur committed May 4, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/benchmark.js
View
14 lib/benchmark.js
@@ -21,7 +21,7 @@ var getTimer = function (timerType) {
var statistics = {
temporalDisrepancy: function (list) {
- var sliceLength = Math.min(list.length / 2, 48);
+ var sliceLength = Math.min(list.length / 2, 64);
return Math.round(100 * this.trimmedMean(list.slice(list.length - sliceLength, list.length)) / this.trimmedMean(list.slice(0, sliceLength))) / 100;
},
sort: function (list) {
@@ -48,11 +48,11 @@ var statistics = {
return Math.round(total / num);
},
trimmedMean: function (list) {
- if (list.length < 3) {
+ if (list.length < 4) {
return this.median(list);
}
this.sort(list);
- return this.mean(list.slice(list.length / 3 - 1, 2 * list.length / 3 - 1));
+ return this.mean(list.slice(list.length / 4, 3 * list.length / 4 - 1));
},
max: function (list) {
return Math.max.apply(null, list);
@@ -65,7 +65,7 @@ var statistics = {
var num = list.length;
this.sort(list);
var median = this.median(list);
- var trimmedMean = this.mean(list.slice(list.length / 3 - 1, 2 * list.length / 3 - 1));
+ var trimmedMean = this.trimmedMean(list);
var result = {
trimmedMean: trimmedMean
, median: median
@@ -229,10 +229,10 @@ Benchmark.prototype.showStats = function (simultaneousRequests, stats) {
colWidths: [
15,
14,
- 6,
+ 8,
21,
- 6,
- 6,
+ 8,
+ 8,
13
],
colAligns: [

0 comments on commit 9d34d9a

Please sign in to comment.