I've tested the latest version of oksvg, which has support for more 
elements, and thus I can test with more SVG files in the codepicdeck 
collection [1]
The tests compare four rendering methods, on my MacBook Pro, MacOS 10.13.4, 
2.3 GHz Intel Core i7, 16GB. 

1) oksvg using GV (svgpng.go) [2]
2) oksvg using FT (svgpngft.go) [3]
3) inkscape command line

dir=`pwd` 
/Applications/Inkscape.app/Contents/Resources/bin/inkscape 
--export-png=$dir/$1.png $dir/$1

4) batik rasterizer 
java -jar $HOME/batik-1.7/batik-rasterizer.jar -m image/png $*

The difference between the GV and FT versions is this diff:


7d6

< "image/color"

11a11

> "github.com/srwiley/scanft"

23,25c23,25

< source := image.NewUniform(color.NRGBA{0, 0, 0, 255})

< scannerGV := rasterx.NewScannerGV(w, h, img, img.Bounds(), source, 
image.Point{0, 0})

< raster := rasterx.NewDasher(w, h, scannerGV)

---

> painter := scanFT.NewRGBAPainter(img)

> scannerFT := scanFT.NewScannerFT(w, h, painter)

> raster := rasterx.NewDasher(w, h, scannerFT)



Here are the results: (times in seconds of real time as measured by the 
time command)


file                 GV FT Ink Batik
cgrid                0.673 0.021 0.725 2.226
clock                0.038 0.023 0.738 3.075
cloud                0.049 0.034 0.586 2.071
color-clouds         0.582 0.059 0.772 2.225
concentric           0.038 0.029 0.689 2.221
concentric2          8.924 0.532 1.537 2.726
conception           0.025 0.017 0.681 2.051
conception2          0.471 0.029 0.749 2.295
cube                 0.122 0.020 0.695 2.221
d4h                  0.077 0.022 0.691 2.195
diag                 2.766 0.058 0.796 2.431
eclipse              0.044 0.015 0.697 2.039
gear                 0.121 0.043 0.697 2.205
go                   0.043 0.032 0.694 2.239
mondrian             0.047 0.016 0.691 2.179
pacman               0.047 0.021 0.695 2.207
plotfunc             0.893 0.025 0.846 2.297
pyramid              0.119 0.031 0.691 2.098
randarc              0.140 0.088 0.713 2.150
randbox              0.253 0.037 0.710 2.213
randspot             0.275 0.068 0.738 2.340
recurse              0.319 0.045 0.707 2.027
richter              0.577 0.019 0.733 2.246
rl                   2.244 0.139 1.019 3.000
schotter             0.356 0.026 0.722 1.967
star                 0.063 0.040 0.695 2.248
starx                0.037 0.024 0.691 2.246

sunearth             2.212 0.026 0.773 2.160

*Conclusion*: the FT methods are very fast, clearly superior to all others 
for these tests (see also the attached chart)
Note that Steven is working on some optimizations that will address the 
spike in the "concentric2" case, but the speed and capability improvements 
are impressive.

[1] https://github.com/ajstarks/deck/tree/master/cmd/codepicdeck/code
[2] https://gist.github.com/ajstarks/78e55b92f9a62200ef5ab7211549589b
[3] https://gist.github.com/ajstarks/9ce776afc3feed9ed957a24c5675555d


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: f.pdf
Description: Adobe PDF document

Reply via email to