Updated CHANGELOG

This commit is contained in:
wout 2017-04-07 20:20:02 +02:00
parent 5e9ed619e6
commit 270874248d
7 changed files with 40 additions and 11 deletions

View File

@ -34,10 +34,11 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
### Fixed
- `clear()` does not remove the parser in svg documents anymore
## [2.5.1] - 2017-03-27
## [2.5.1](https://github.com/svgdotjs/svg.js/releases/tag/2.5.1) - 2017-03-27
### Fixed
- fixed `SVG.PathArray.parse` that did not correctly parsed flat arrays
- prevented unnecessary parsing of point or path strings
### Changed
- make svgjs ready to be used on the server

View File

@ -40,6 +40,7 @@
<script src="../dist/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-each.js"></script> -->
<script src="tests/10000-rects.js"></script>
<script src="tests/10000-circles.js"></script>
<script src="tests/10000-paths.js"></script>

View File

@ -1,5 +1,5 @@
SVG.bench.describe('Generate 10000 circles', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.circle(100,100)
})
@ -18,7 +18,7 @@ SVG.bench.describe('Generate 10000 circles', function(bench) {
})
SVG.bench.describe('Generate 10000 circles with fill', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.circle(100,100).fill('#f06')
})

27
bench/tests/10000-each.js Normal file
View File

@ -0,0 +1,27 @@
SVG.bench.describe('each() vs forEach()', function(bench) {
// preparation
var list = []
for (var i = 99; i >= 0; i--)
list.push(bench.draw.rect(100, 50))
var set = new SVG.Set(list)
bench.test('10000 x each()', function() {
for (var i = 0; i < 10000; i++) {
set.each(function() {
this.fill('#f06')
})
}
})
bench.test('10000 x forEach()', function() {
for (var i = 0; i < 10000; i++) {
list.forEach(function(e) {
e.fill('#f06')
})
}
})
})

View File

@ -5,17 +5,17 @@ SVG.bench.describe('Generate 10000 pathArrays', function(bench) {
var data3 = 'M10 10-45-30.5.5 .89L2e-2.5.5.5-.5C.5.5.5.5.5.5L-3-4z'
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
new SVG.PathArray(data)
})
bench.test('using SVG.js v2.4.0 more data', function() {
bench.test('using SVG.js v2.5.1 more data', function() {
for (var i = 0; i < 10000; i++)
new SVG.PathArray(data2)
})
bench.test('using SVG.js v2.4.0 complicated data', function() {
bench.test('using SVG.js v2.5.1 complicated data', function() {
for (var i = 0; i < 10000; i++)
new SVG.PathArray(data3)
})

View File

@ -1,7 +1,7 @@
SVG.bench.describe('Generate 10000 paths', function(bench) {
var data = 'M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100'
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.path(data)
})

View File

@ -1,5 +1,5 @@
SVG.bench.describe('Generate 10000 rects', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100)
})
@ -19,7 +19,7 @@ SVG.bench.describe('Generate 10000 rects', function(bench) {
SVG.bench.describe('Generate 10000 rects with fill', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100).fill('#f06')
})
@ -40,7 +40,7 @@ SVG.bench.describe('Generate 10000 rects with fill', function(bench) {
SVG.bench.describe('Generate 10000 rects with position and fill', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++)
bench.draw.rect(100,100).move(50,50).fill('#f06')
})
@ -63,7 +63,7 @@ SVG.bench.describe('Generate 10000 rects with position and fill', function(bench
SVG.bench.describe('Generate 10000 rects with gradient fill', function(bench) {
bench.test('using SVG.js v2.4.0', function() {
bench.test('using SVG.js v2.5.1', function() {
for (var i = 0; i < 10000; i++) {
var g = bench.draw.gradient('linear', function(stop) {
stop.at(0, '#000')