Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Graphics perf tests. Fix #2532882

  • Loading branch information...
commit 138eeedad0a23564ee6473a4354f048419d2de5c 1 parent 1b53d2b
@tripp tripp authored
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
View
37 src/graphics/tests/perf/circle-benchmark.js
@@ -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']});
View
105 src/graphics/tests/perf/circle.html
@@ -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>
View
34 src/graphics/tests/perf/circlenofill-benchmark.js
@@ -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']});
View
105 src/graphics/tests/perf/circlenofill.html
@@ -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>
View
34 src/graphics/tests/perf/circlenostroke-benchmark.js
@@ -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']});
View
105 src/graphics/tests/perf/circlenostroke.html
@@ -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="circlenostroke-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']
+ },
+ 'circlenostroke-benchmark': {
+ fullpath: 'circlenostroke-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', 'circlenostroke-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: 'circlenostroke-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'circlenostroke-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>
View
38 src/graphics/tests/perf/ellipse-benchmark.js
@@ -0,0 +1,38 @@
+YUI.add('ellipse-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("Ellipse", function() {
+ var ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/ellipse.html
@@ -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="ellipse-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']
+ },
+ 'ellipse-benchmark': {
+ fullpath: 'ellipse-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', 'ellipse-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: 'ellipse-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'ellipse-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>
View
35 src/graphics/tests/perf/ellipsenofill-benchmark.js
@@ -0,0 +1,35 @@
+YUI.add('ellipsenofill-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("EllipseNoFill", function() {
+ var ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/ellipsenofill.html
@@ -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="ellipsenofill-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']
+ },
+ 'ellipsenofill-benchmark': {
+ fullpath: 'ellipsenofill-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', 'ellipsenofill-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: 'ellipsenofill-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'ellipsenofill-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>
View
35 src/graphics/tests/perf/ellipsenostroke-benchmark.js
@@ -0,0 +1,35 @@
+YUI.add('ellipsenostroke-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("EllipseNoStroke", function() {
+ var ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/ellipsenostroke.html
@@ -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="ellipsenostroke-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']
+ },
+ 'ellipsenostroke-benchmark': {
+ fullpath: 'ellipsenostroke-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', 'ellipsenostroke-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: 'ellipsenostroke-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'ellipsenostroke-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>
View
61 src/graphics/tests/perf/multipleshapes-benchmark.js
@@ -0,0 +1,61 @@
+YUI.add('multipleshapes-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("MultipleShapes", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ }),
+ rect = graphic.addShape({
+ type: "rect",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ }),
+ ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/multipleshapes.html
@@ -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="multipleshapes-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']
+ },
+ 'multipleshapes-benchmark': {
+ fullpath: 'multipleshapes-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', 'multipleshapes-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: 'multipleshapes-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'multipleshapes-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>
View
52 src/graphics/tests/perf/multipleshapesnofill-benchmark.js
@@ -0,0 +1,52 @@
+YUI.add('multipleshapesnofill-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("MultipleShapesNoFill", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ }),
+ rect = graphic.addShape({
+ type: "rect",
+ width: 16,
+ height: 8,
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ }),
+ ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/multipleshapesnofill.html
@@ -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="multipleshapesnofill-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']
+ },
+ 'multipleshapesnofill-benchmark': {
+ fullpath: 'multipleshapesnofill-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', 'multipleshapesnofill-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: 'multipleshapesnofill-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'multipleshapesnofill-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>
View
52 src/graphics/tests/perf/multipleshapesnostroke-benchmark.js
@@ -0,0 +1,52 @@
+YUI.add('multipleshapesnostroke-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("MultipleShapesNoStroke", function() {
+ var circle = graphic.addShape({
+ type: "circle",
+ radius: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ }),
+ rect = graphic.addShape({
+ type: "rect",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ }),
+ ellipse = graphic.addShape({
+ type: "ellipse",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/multipleshapesnostroke.html
@@ -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="multipleshapesnostroke-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']
+ },
+ 'multipleshapesnostroke-benchmark': {
+ fullpath: 'multipleshapesnostroke-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', 'multipleshapesnostroke-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: 'multipleshapesnostroke-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'multipleshapesnostroke-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>
View
52 src/graphics/tests/perf/path-benchmark.js
@@ -0,0 +1,52 @@
+YUI.add('path-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ top = 10,
+ container = document.createElement('div');
+ container.style.display = "block";
+ 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("Path", function() {
+ var x = 0,
+ y,
+ i,
+ len = 200,
+ path = graphic.addShape({
+ type: "path",
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ path.clear();
+ path.moveTo(0, top);
+ for(i = 0; i < len; i = i + 1)
+ {
+ y = i % 2 === 0 ? (top + 25) : top;
+ x = x + 5;
+ path.lineTo(x, y);
+ }
+ path.end();
+ top = top + 25;
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/path.html
@@ -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="path-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']
+ },
+ 'path-benchmark': {
+ fullpath: 'path-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', 'path-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: 'path-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'path-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>
View
49 src/graphics/tests/perf/pathnofill-benchmark.js
@@ -0,0 +1,49 @@
+YUI.add('pathnofill-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ top = 10,
+ container = document.createElement('div');
+ container.style.display = "block";
+ 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("PathNoFill", function() {
+ var x = 0,
+ y,
+ i,
+ len = 200,
+ path = graphic.addShape({
+ type: "path",
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ path.clear();
+ path.moveTo(0, top);
+ for(i = 0; i < len; i = i + 1)
+ {
+ y = i % 2 === 0 ? (top + 25) : top;
+ x = x + 5;
+ path.lineTo(x, y);
+ }
+ path.end();
+ top = top + 25;
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/pathnofill.html
@@ -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="pathnofill-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': {
+ fullpathnofill: '../../../common/tests/perf/multi.js',
+ requires: ['event-custom']
+ },
+ 'pathnofill-benchmark': {
+ fullpathnofill: 'pathnofill-benchmark.js',
+ requires: ['graphics']
+ },
+ 'skin-sam-test-console': {
+ fullpathnofill: '../../../common/tests/assets/test-console.css',
+ type : 'css'
+ },
+
+ 'test-console': {
+ fullpathnofill : '../../../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', 'pathnofill-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: 'pathnofill-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'pathnofill-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>
View
49 src/graphics/tests/perf/pathnostroke-benchmark.js
@@ -0,0 +1,49 @@
+YUI.add('pathnostroke-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,
+ graphic,
+ top = 10,
+ container = document.createElement('div');
+ container.style.display = "block";
+ 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("PathNoStroke", function() {
+ var x = 0,
+ y,
+ i,
+ len = 200,
+ path = graphic.addShape({
+ type: "path",
+ fill: {
+ color: "#9aa"
+ },
+ stroke: null
+ });
+ path.clear();
+ path.moveTo(0, top);
+ for(i = 0; i < len; i = i + 1)
+ {
+ y = i % 2 === 0 ? (top + 25) : top;
+ x = x + 5;
+ path.lineTo(x, y);
+ }
+ path.end();
+ top = top + 25;
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/pathnostroke.html
@@ -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="pathnostroke-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': {
+ fullpathnostroke: '../../../common/tests/perf/multi.js',
+ requires: ['event-custom']
+ },
+ 'pathnostroke-benchmark': {
+ fullpathnostroke: 'pathnostroke-benchmark.js',
+ requires: ['graphics']
+ },
+ 'skin-sam-test-console': {
+ fullpathnostroke: '../../../common/tests/assets/test-console.css',
+ type : 'css'
+ },
+
+ 'test-console': {
+ fullpathnostroke : '../../../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', 'pathnostroke-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: 'pathnostroke-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'pathnostroke-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>
View
38 src/graphics/tests/perf/rect-benchmark.js
@@ -0,0 +1,38 @@
+YUI.add('rect-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("Rect", function() {
+ var rect = graphic.addShape({
+ type: "rect",
+ width: 16,
+ height: 8,
+ fill: {
+ color: "#9aa"
+ },
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/rect.html
@@ -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="rect-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']
+ },
+ 'rect-benchmark': {
+ fullpath: 'rect-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', 'rect-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: 'rect-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'rect-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>
View
35 src/graphics/tests/perf/rectnofill-benchmark.js
@@ -0,0 +1,35 @@
+YUI.add('rectnofill-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("RectNoFill", function() {
+ var rect = graphic.addShape({
+ type: "rect",
+ width: 16,
+ height: 8,
+ stroke: {
+ color: "#333",
+ weight: 1
+ }
+ });
+ }, {
+ onStart: function() {
+ graphic = new Y.Graphic({
+ render: container
+ });
+ },
+
+ onComplete: function() {
+ graphic.destroy();
+ }
+ });
+
+}, '@VERSION@', {requires: ['graphics']});
View
105 src/graphics/tests/perf/rectnofill.html
@@ -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="rectnofill-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']
+ },
+ 'rectnofill-benchmark': {
+ fullpath: 'rectnofill-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', 'rectnofill-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: 'rectnofill-benchmark',
+ url: 'http://yui.yahooapis.com/3.7.3/build/yui/yui.js',
+ use: ['graphics', 'rectnofill-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>
View
35 src/graphics/tests/perf/rectnostroke-benchmark.js
@@ -0,0 +1,35 @@
+YUI.add('rectnostroke-benchmark', function (Y) {
+ Y.BenchmarkSuite = new Benchmark.Suite();
+ var suite = Y.BenchmarkSuite,