1 Name: HTML5 Game Benchmarks
2 URL: git://github.com/sibblingz/PerfMarks
3 URL: http://spaceport.io/community/perfmarks
6 Revision: c2dcbffeb492430c27160cb1ba5d6f1a2bf75d0a
7 License: Various, see license file
10 Additional files, not in the original suite:
13 Modifications to the test suite to enable running as a cross browser performance test.
18 1. In js/index.js, change the 'step' attribute to add the required console.log
19 statements. Below is the patch.
21 diff --git a/js/index.js b/js/index.js
22 index 2c23d0d..059a57a 100644
25 @@ -36,17 +36,25 @@ define([ 'tests/performance', 'testDom', 'testRunner', 'tables', 'util/report',
26 function runPerformanceTests(callback) {
27 callback = ensureCallback(callback);
29 testRunner.run('performance', performance, {
30 done: function (err, results) {
31 allTestsDone(err, results);
32 callback(err, results);
35 + step: function (err, name, results) {
36 + shortName = name.replace('performance.sprites.image.', '');
38 + console.log(shortName + ": " + results.objectCount);
40 + console.log(shortName + ": 0");
42 + return testDone(err, name, results);
47 function runAndUploadPerformanceTests(callback) {
48 callback = ensureCallback(callback);
50 runPerformanceTests(function (err, results) {
51 if (err) return callback(err);
53 2. In js/tests/sprites.js, apply the below patch to keep too many objects from
54 being created on fast desktop machines.
56 diff --git a/chrome/test/data/third_party/spaceport/js/tests/sprites.js b/chrome/test/data/third_party/spaceport/js/tests/s
57 index b491fe6..64b2d03 100644
58 --- a/chrome/test/data/third_party/spaceport/js/tests/sprites.js
59 +++ b/chrome/test/data/third_party/spaceport/js/tests/sprites.js
60 @@ -168,7 +168,7 @@ define([ 'sprites/sources', 'sprites/transformers', 'sprites/renderers', 'util/e
61 rawData.push([ objectCount, results ]);
63 var timePerObjectEstimate = 1/(objectCount*results.fps);
64 - var estimatedMaxObjects = Math.floor(1/(targetFramerate * timePerObjectEstimate));
65 + var estimatedMaxObjects = Math.min(5000, Math.floor(1/(targetFramerate * timePerObjectEstimate)));
67 var nextObjectCount = nextNumberToTry(fpsResults, estimatedMaxObjects);
68 test(nextObjectCount);