From 390d0eb97ff1cde5dc61bcf460687c618f67f98e Mon Sep 17 00:00:00 2001 From: Hanjoung Lee Date: Mon, 23 Nov 2015 17:07:03 +0900 Subject: [PATCH] Update benchmark page. --- benchmark/benchmark.html | 20 ++++++++++++++------ benchmark/benchmark.js | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/benchmark/benchmark.html b/benchmark/benchmark.html index ac814741e..150f661ba 100644 --- a/benchmark/benchmark.html +++ b/benchmark/benchmark.html @@ -15,25 +15,33 @@

Jerryscript Benchmark

- lower is better - for both memory and performance. + Show data + by_sum / + by max + value of subtests

+

sunspider-1.0.2

-
-
+
loading...
+
loading...

ubench

-
-
+
loading...
+
loading...
+

+ lower is better + for both memory and performance. +

+ diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js index 657b2b4ea..48669904c 100644 --- a/benchmark/benchmark.js +++ b/benchmark/benchmark.js @@ -10,6 +10,10 @@ Array.prototype.sum = function() { return this.reduce(function(a, b) { return a + b; }); }; +Array.prototype.max = function() { + return this.reduce(function(a, b) { return Math.max(a, b); }); +}; + Date.prototype.toFormattedString = function() { var yyyy = this.getFullYear().toString(); var mm = (this.getMonth() + 1).toString(); @@ -42,6 +46,8 @@ function wrapHyperlink(address, text) { // main module /////////////////////////////////////////// +var isSum = true; + var benchmarks = ['sunspider-1.0.2', 'ubench']; var measureTypes = ['memory', 'performance']; var measureUnits = {'memory': 'kb', 'performance': 's'}; @@ -62,9 +68,12 @@ google.load('visualization', '1', {packages: ['corechart', 'line']}); google.setOnLoadCallback(main); function main() { - var data_src = getParameterByName('src'); - if (!data_src) - data_src = 'data'; + // get params + var data_src = getParameterByName('src') || 'data'; + var show = getParameterByName('show') || 'sum'; + + isSum = show === 'sum'; + // fetch data via ajax var today = new Date(); for (var d = beginDate; d <= today; d.setDate(d.getDate() + 1)) { @@ -100,7 +109,7 @@ $(document).ajaxStop(function () { // record object contains a lot of subtests, // we use sum of all values as representative value var values = Object.values(record); - repVal = values.sum(); + repVal = isSum ? values.sum() : values.max(); numTests = values.length; } } @@ -133,8 +142,7 @@ $(document).ajaxStop(function () { ['source  ', engine_text], ['version ', info_text], ['date    ', date], - ['score   ', score], - ['tests   ', tests]]; + ['score   ', score + ' (' + tests + ' subtests)']]; return wrapTooltip(textData.map(function(v) { return v.join(': '); }).join('
')); });