Permalink
Browse files

Graphics perf tests. Fix #2532882

  • Loading branch information...
tripp committed Nov 6, 2012
1 parent 1b53d2b commit 138eeedad0a23564ee6473a4354f048419d2de5c
Showing with 2,211 additions and 0 deletions.
  1. +37 −0 src/graphics/tests/perf/circle-benchmark.js
  2. +105 −0 src/graphics/tests/perf/circle.html
  3. +34 −0 src/graphics/tests/perf/circlenofill-benchmark.js
  4. +105 −0 src/graphics/tests/perf/circlenofill.html
  5. +34 −0 src/graphics/tests/perf/circlenostroke-benchmark.js
  6. +105 −0 src/graphics/tests/perf/circlenostroke.html
  7. +38 −0 src/graphics/tests/perf/ellipse-benchmark.js
  8. +105 −0 src/graphics/tests/perf/ellipse.html
  9. +35 −0 src/graphics/tests/perf/ellipsenofill-benchmark.js
  10. +105 −0 src/graphics/tests/perf/ellipsenofill.html
  11. +35 −0 src/graphics/tests/perf/ellipsenostroke-benchmark.js
  12. +105 −0 src/graphics/tests/perf/ellipsenostroke.html
  13. +61 −0 src/graphics/tests/perf/multipleshapes-benchmark.js
  14. +105 −0 src/graphics/tests/perf/multipleshapes.html
  15. +52 −0 src/graphics/tests/perf/multipleshapesnofill-benchmark.js
  16. +105 −0 src/graphics/tests/perf/multipleshapesnofill.html
  17. +52 −0 src/graphics/tests/perf/multipleshapesnostroke-benchmark.js
  18. +105 −0 src/graphics/tests/perf/multipleshapesnostroke.html
  19. +52 −0 src/graphics/tests/perf/path-benchmark.js
  20. +105 −0 src/graphics/tests/perf/path.html
  21. +49 −0 src/graphics/tests/perf/pathnofill-benchmark.js
  22. +105 −0 src/graphics/tests/perf/pathnofill.html
  23. +49 −0 src/graphics/tests/perf/pathnostroke-benchmark.js
  24. +105 −0 src/graphics/tests/perf/pathnostroke.html
  25. +38 −0 src/graphics/tests/perf/rect-benchmark.js
  26. +105 −0 src/graphics/tests/perf/rect.html
  27. +35 −0 src/graphics/tests/perf/rectnofill-benchmark.js
  28. +105 −0 src/graphics/tests/perf/rectnofill.html
  29. +35 −0 src/graphics/tests/perf/rectnostroke-benchmark.js
  30. +105 −0 src/graphics/tests/perf/rectnostroke.html
@@ -0,0 +1,37 @@
+YUI.add('circle-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ container = document.createElement('div');
+ container.style.left = "10px";
+ container.style.top = "10px";
+ container.style.width = "600px";
+ container.style.height = "300px";
+ container.id = "container";
+ document.body.appendChild(container);
+
+ suite.add("Circle", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <applet code="../../../common/tests/perf/nano.jar" archive="../../../common/tests/perf/nano.jar" style="display: none;"></applet>
+ <script type='text/javascript' src="../../../common/tests/perf/benchmark.js"></script>
+ <script src="../../../../build/yui/yui.js"></script>
+ <script src="../../../common/tests/perf/multi.js"></script>
+ <script src="circle-benchmark.js"></script>
+ </head>
+
+ <body class='yui3-skin-sam'>
+
+ <p><button id="start">Start Benchmarks against Local YUI</button></p>
+ <p><button id="iframe-start" disabled='true'>Start Benchmarks against YUI3.7.3</button></p>
+ <div id="log"></div>
+ <script>
+
+ YUI({
+ 'multi': {
+ fullpath: '../../../common/tests/perf/multi.js',
+ requires: ['event-custom']
+ },
+ 'circle-benchmark': {
+ fullpath: 'circle-benchmark.js',
+ requires: ['graphics']
+ },
+ 'skin-sam-test-console': {
+ fullpath: '../../../common/tests/assets/test-console.css',
+ type : 'css'
+ },
+
+ 'test-console': {
+ fullpath : '../../../common/tests/assets/test-console.js',
+ requires : ['console-filters'],
+ skinnable: true
+ },
+ defaultGraphicEngine: (window.location.search.match(/[?&]defaultGraphicEngine=([^&]+)/) || [])[1] || 'svg',
+ filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw',
+ useBrowserConsole: false
+ }).use('graphics', 'multi', 'circle-benchmark', 'skin-sam-test-console', 'test-console', function (Y) {
+
+ new Y.Console().render('#log');
+
+
+ var suite = Y.BenchmarkSuite,
+ start = Y.one('#start'),
+ iframeStart = Y.one("#iframe-start"),
+ iY;
+
+ var multi = new Y.Multi({
+ seeds: {
+ Y_373: {
+ test: 'circle-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'circle-benchmark']
+ }
+ }
+ });
+
+ multi.on('ready', function () {
+ iframeStart.set('disabled', false);
+ iY = multi.Y_373;
+ });
+
+ suite.on('start', function () {
+ Y.log('Starting benchmarks on local YUI.');
+ });
+
+ suite.on('cycle', function (ev) {
+ Y.log(String(ev.target));
+ });
+
+ suite.on('complete', function () {
+ start.set('disabled', false);
+ Y.log('Finished benchmarks on local YUI.');
+ });
+
+ start.on('click', function () {
+ suite.run({async:true});
+ });
+
+ iframeStart.on('click', function () {
+ var suite = iY.BenchmarkSuite;
+ suite.on('start', function () {
+ Y.log('Starting benchmarks on old YUI.');
+ });
+
+ suite.on('cycle', function (ev) {
+ Y.log(String(ev.target));
+ });
+
+ suite.on('complete', function () {
+ Y.log('Finished benchmarks on old YUI.');
+ });
+
+ suite.run({async:true});
+
+ })
+ });
+
+
+ </script>
+ </body>
+</html>
@@ -0,0 +1,34 @@
+YUI.add('circlenofill-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ container = document.createElement('div');
+ container.style.left = "10px";
+ container.style.top = "10px";
+ container.style.width = "600px";
+ container.style.height = "300px";
+ container.id = "container";
+ document.body.appendChild(container);
+
+ suite.add("CircleNoFill", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ stroke: {
+ weight: 1,
+ color: "#333"
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <applet code="../../../common/tests/perf/nano.jar" archive="../../../common/tests/perf/nano.jar" style="display: none;"></applet>
+ <script type='text/javascript' src="../../../common/tests/perf/benchmark.js"></script>
+ <script src="../../../../build/yui/yui.js"></script>
+ <script src="../../../common/tests/perf/multi.js"></script>
+ <script src="circlenofill-benchmark.js"></script>
+ </head>
+
+ <body class='yui3-skin-sam'>
+
+ <p><button id="start">Start Benchmarks against Local YUI</button></p>
+ <p><button id="iframe-start" disabled='true'>Start Benchmarks against YUI3.7.3</button></p>
+ <div id="log"></div>
+ <script>
+
+ YUI({
+ 'multi': {
+ fullpath: '../../../common/tests/perf/multi.js',
+ requires: ['event-custom']
+ },
+ 'circlenofill-benchmark': {
+ fullpath: 'circlenofill-benchmark.js',
+ requires: ['graphics']
+ },
+ 'skin-sam-test-console': {
+ fullpath: '../../../common/tests/assets/test-console.css',
+ type : 'css'
+ },
+
+ 'test-console': {
+ fullpath : '../../../common/tests/assets/test-console.js',
+ requires : ['console-filters'],
+ skinnable: true
+ },
+ defaultGraphicEngine: (window.location.search.match(/[?&]defaultGraphicEngine=([^&]+)/) || [])[1] || 'svg',
+ filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw',
+ useBrowserConsole: false
+ }).use('graphics', 'multi', 'circlenofill-benchmark', 'skin-sam-test-console', 'test-console', function (Y) {
+
+ new Y.Console().render('#log');
+
+
+ var suite = Y.BenchmarkSuite,
+ start = Y.one('#start'),
+ iframeStart = Y.one("#iframe-start"),
+ iY;
+
+ var multi = new Y.Multi({
+ seeds: {
+ Y_373: {
+ test: 'circlenofill-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'circlenofill-benchmark']
+ }
+ }
+ });
+
+ multi.on('ready', function () {
+ iframeStart.set('disabled', false);
+ iY = multi.Y_373;
+ });
+
+ suite.on('start', function () {
+ Y.log('Starting benchmarks on local YUI.');
+ });
+
+ suite.on('cycle', function (ev) {
+ Y.log(String(ev.target));
+ });
+
+ suite.on('complete', function () {
+ start.set('disabled', false);
+ Y.log('Finished benchmarks on local YUI.');
+ });
+
+ start.on('click', function () {
+ suite.run({async:true});
+ });
+
+ iframeStart.on('click', function () {
+ var suite = iY.BenchmarkSuite;
+ suite.on('start', function () {
+ Y.log('Starting benchmarks on old YUI.');
+ });
+
+ suite.on('cycle', function (ev) {
+ Y.log(String(ev.target));
+ });
+
+ suite.on('complete', function () {
+ Y.log('Finished benchmarks on old YUI.');
+ });
+
+ suite.run({async:true});
+
+ })
+ });
+
+
+ </script>
+ </body>
+</html>
@@ -0,0 +1,34 @@
+YUI.add('circlenostroke-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ container = document.createElement('div');
+ container.style.left = "10px";
+ container.style.top = "10px";
+ container.style.width = "600px";
+ container.style.height = "300px";
+ container.id = "container";
+ document.body.appendChild(container);
+
+ suite.add("CircleNoStroke", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
Oops, something went wrong.

0 comments on commit 138eeed

Please sign in to comment.