xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <de...@meteo.be>
Subject batik performances best practices
Date Mon, 10 Mar 2014 16:05:20 GMT

we have developped a swing application that uses batik as it's main rendering interface, mainly
because it was a vector based application. This application has an animation button, where,
frame after frame, we change the content of the svg tree, mainly by raplacing a whole subtree.
This basicaly look like this 

setCurrentFrame(int frame){ 
SVGElement newChild = getSVG(frame); 
oldChild = newChild(); 

called in a loop. The best we achieve is 12fps this way. If we remove the animated background,
we go up to 19fps. It's simplified, the real operation are done using a Runnable added to
the updatequeue of batik, so visual is up to date. 

My problem is that batik recalculates, for newChild, the GVT, which is obviously needed to
display the SVG on the JSVGCanvas. Profiling operation show most of my time (~80%) is spent
in GVT builder. Is there some way to tell batik to remember "newChild" so that, next time
(next loop) i reinsert newChild, it doesn't need to rebuild the GVT tree but can reuse the
previous one? 
Do you have any recommandation on how to handle animations with better performances? 

thanks for help 

David Delbecq 

View raw message