aboutsummaryrefslogtreecommitdiffstats
path: root/bench/tests
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2016-08-04 18:06:22 +0200
committerwout <wout@impinc.co.uk>2016-08-04 18:06:22 +0200
commitf61670db80913e5261811ad36b08e74d03e23771 (patch)
tree1fde1f20bd650c26ee7ea0a2338ada65ba41badd /bench/tests
parentf25ba0e7457cc59c6c22714619f8d8ce7526b3e8 (diff)
downloadsvg.js-f61670db80913e5261811ad36b08e74d03e23771.tar.gz
svg.js-f61670db80913e5261811ad36b08e74d03e23771.zip
Added benchmark script
Diffstat (limited to 'bench/tests')
-rw-r--r--bench/tests/element-creation.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/bench/tests/element-creation.js b/bench/tests/element-creation.js
new file mode 100644
index 0000000..6e35a08
--- /dev/null
+++ b/bench/tests/element-creation.js
@@ -0,0 +1,18 @@
+;(function(bench) {
+
+ bench.test('generate 10000 rects', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.draw.rect(100,100)
+ })
+
+ bench.test('generate 10000 rects with fill', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.draw.rect(100,100).fill('#f06')
+ })
+
+ bench.test('generate 10000 rects with position and fill', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.draw.rect(100,100).move(50,50).fill('#f06')
+ })
+
+})(SVG.bench); \ No newline at end of file