summaryrefslogtreecommitdiffstats
path: root/bench/tests
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2016-08-04 21:19:53 +0200
committerwout <wout@impinc.co.uk>2016-08-04 21:19:53 +0200
commit0e23fcd9ef56f369763505dbb22c3f5ab23a0b17 (patch)
treef1a86a9a4d3cfdcee3b64b135118a5e9a2ed39fd /bench/tests
parent16575bdca041c6f04042058d05b4867f882b65bd (diff)
downloadsvg.js-0e23fcd9ef56f369763505dbb22c3f5ab23a0b17.tar.gz
svg.js-0e23fcd9ef56f369763505dbb22c3f5ab23a0b17.zip
Added Snap.svg to benchmarking system
Diffstat (limited to 'bench/tests')
-rw-r--r--bench/tests/element-creation.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/bench/tests/element-creation.js b/bench/tests/element-creation.js
index 107c353..f0e4143 100644
--- a/bench/tests/element-creation.js
+++ b/bench/tests/element-creation.js
@@ -1,11 +1,10 @@
(function(bench) {
var svgns = 'http://www.w3.org/2000/svg'
- bench.test('svg.js: generate 10000 rects', function() {
+ bench.test('svg.js v2.3.4: generate 10000 rects', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100)
})
-
bench.test('native: generate 10000 rects', function() {
for (var i = 0; i < 10000; i++) {
var rect = document.createElementNS(svgns, 'rect')
@@ -14,12 +13,15 @@
bench.raw.appendChild(rect)
}
})
+ bench.test('Snap.svg v0.41: generate 10000 rects', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.snap.rect(50, 50, 100, 100)
+ })
- bench.test('svg.js: generate 10000 rects with fill', function() {
+ bench.test('svg.js v2.3.4: generate 10000 rects with fill', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100).fill('#f06')
})
-
bench.test('native: generate 10000 rects with fill', function() {
for (var i = 0; i < 10000; i++) {
var rect = document.createElementNS(svgns, 'rect')
@@ -29,12 +31,15 @@
bench.raw.appendChild(rect)
}
})
+ bench.test('Snap.svg v0.41: generate 10000 rects with fill', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.snap.rect(50, 50, 100, 100).attr('fill', '#f06')
+ })
- bench.test('svg.js: generate 10000 rects with position and fill', function() {
+ bench.test('svg.js v2.3.4: 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')
})
-
bench.test('native: generate 10000 rects with position and fill', function() {
for (var i = 0; i < 10000; i++) {
var rect = document.createElementNS(svgns, 'rect')
@@ -46,5 +51,9 @@
bench.raw.appendChild(rect)
}
})
+ bench.test('Snap.svg v0.41: generate 10000 rects with fill and position', function() {
+ for (var i = 0; i < 10000; i++)
+ bench.snap.rect(50, 50, 100, 100).attr('fill', '#f06')
+ })
})(SVG.bench) \ No newline at end of file