Name: HTML5 Game Benchmarks URL: git://github.com/sibblingz/PerfMarks URL: http://spaceport.io/community/perfmarks Version: 0 Date: May 14, 2012 Revision: c2dcbffeb492430c27160cb1ba5d6f1a2bf75d0a License: Various, see license file License File: LICENSE Additional files, not in the original suite: README.chromium Modifications to the test suite to enable running as a cross browser performance test. js/index.js How to update: 1. In js/index.js, change the 'step' attribute to add the required console.log statements. Below is the patch. diff --git a/js/index.js b/js/index.js index 2c23d0d..059a57a 100644 --- a/js/index.js +++ b/js/index.js @@ -36,17 +36,25 @@ define([ 'tests/performance', 'testDom', 'testRunner', 'tables', 'util/report', function runPerformanceTests(callback) { callback = ensureCallback(callback); testRunner.run('performance', performance, { done: function (err, results) { allTestsDone(err, results); callback(err, results); }, - step: testDone + step: function (err, name, results) { + shortName = name.replace('performance.sprites.image.', ''); + if (results) { + console.log(shortName + ": " + results.objectCount); + } else { + console.log(shortName + ": 0"); + } + return testDone(err, name, results); + } }); } function runAndUploadPerformanceTests(callback) { callback = ensureCallback(callback); runPerformanceTests(function (err, results) { if (err) return callback(err); 2. In js/tests/sprites.js, apply the below patch to keep too many objects from being created on fast desktop machines. diff --git a/chrome/test/data/third_party/spaceport/js/tests/sprites.js b/chrome/test/data/third_party/spaceport/js/tests/s index b491fe6..64b2d03 100644 --- a/chrome/test/data/third_party/spaceport/js/tests/sprites.js +++ b/chrome/test/data/third_party/spaceport/js/tests/sprites.js @@ -168,7 +168,7 @@ define([ 'sprites/sources', 'sprites/transformers', 'sprites/renderers', 'util/e rawData.push([ objectCount, results ]); var timePerObjectEstimate = 1/(objectCount*results.fps); - var estimatedMaxObjects = Math.floor(1/(targetFramerate * timePerObjectEstimate)); + var estimatedMaxObjects = Math.min(5000, Math.floor(1/(targetFramerate * timePerObjectEstimate))); var nextObjectCount = nextNumberToTry(fpsResults, estimatedMaxObjects); test(nextObjectCount);