<div id="draw"></div>
<svg id="native" width="100" height="100" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"></svg>
<script src="../dist/svg.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg.js"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.5.1/snap.svg-min.js"></script>
<script src="svg.bench.js"></script>
<script src="tests/10000-rects.js"></script>
<script src="tests/10000-circles.js"></script>
// Run tests
, run: function() {
- this.pad(true)
+ this.pad()
for (var h, i = 0, il = this._chain.length; i < il; i++) {
var h = document.createElement('h1')
SVG.bench.describe('Generate 10000 circles', function(bench) {
- bench.skip('using svg.js v2.3.4', function() {
+ bench.test('using SVG.js v2.4.0', function() {
for (var i = 0; i < 10000; i++)
bench.draw.circle(100,100)
})
- bench.skip('using vanilla js', function() {
+ bench.test('using vanilla js', function() {
for (var i = 0; i < 10000; i++) {
var circle = document.createElementNS(SVG.ns, 'circle')
circle.setAttributeNS(null, 'rx', 50)
bench.raw.appendChild(circle)
}
})
- bench.skip('using Snap.svg v0.41', function() {
+ bench.test('using Snap.svg v0.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.snap.circle(50, 50, 100, 100)
})
})
SVG.bench.describe('Generate 10000 circles with fill', function(bench) {
- bench.test('using svg.js v2.3.4', function() {
+ bench.test('using SVG.js v2.4.0', function() {
for (var i = 0; i < 10000; i++)
bench.draw.circle(100,100).fill('#f06')
})
bench.raw.appendChild(circle)
}
})
- bench.test('using Snap.svg v0.41', function() {
+ bench.test('using Snap.svg v0.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.snap.circle(50, 50, 100, 100).attr('fill', '#f06')
})
SVG.bench.describe('Generate 10000 rects', function(bench) {
- bench.test('using svg.js v2.3.4', function() {
+ bench.test('using SVG.js v2.4.0', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100)
})
bench.raw.appendChild(rect)
}
})
- bench.test('using Snap.svg v0.41', function() {
+ bench.test('using Snap.svg v0.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.snap.rect(50, 50, 100, 100)
})
})
SVG.bench.describe('Generate 10000 rects with fill', function(bench) {
- bench.test('using svg.js v2.3.4', function() {
+ bench.test('using SVG.js v2.4.0', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100).fill('#f06')
})
bench.raw.appendChild(rect)
}
})
- bench.test('using Snap.svg v0.41', function() {
+ bench.test('using Snap.svg v0.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.snap.rect(50, 50, 100, 100).attr('fill', '#f06')
})
})
SVG.bench.describe('Generate 10000 rects with position and fill', function(bench) {
- bench.test('using svg.js v2.3.4', function() {
+ bench.test('using SVG.js v2.4.0', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100).move(50,50).fill('#f06')
})
bench.raw.appendChild(rect)
}
})
- bench.test('using Snap.svg v0.41', function() {
+ bench.test('using Snap.svg v0.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.snap.rect(50, 50, 100, 100).attr('fill', '#f06')
})