>>>>> "SB" == Siarhei Biarozkin <[EMAIL PROTECTED]> writes:

SB> Hello, We're using JSVGCanvas to show the SVG content in the
SB> follwing way :

SB> 1. Svg file is generated on the server 2. Our viewer, a subclass
SB> of JSVGCanvas, calls JSVGDocument.loadSVGDocument(URL path to the
SB> svg file)

SB> It takes at least 5secs to draw that svg file (8K, it contains a
SB> lot of group <g> blocks with basic elements like <rect> and <text>
SB> inside).  

    It sounds like a fairly small file, so I assume the 5secs is for
the 'first time' display?  Most of this time is Java loading classes
and the JIT getting going, so there isn't much we can do about this.
After the first time does it redraw much faster?

SB> I'll certainly try to increase the size of JVM-heap at startup,
SB> but apart from that, Is there any way on the application level to
SB> accelerate the process ?

    Text is probably our biggest problem for performance.  If you use
lots of tspan's you might try to find ways to reduce them.

SB> When the file is succesfully loaded and displayed, we start
SB> manipulating some of the properties of the resulting SVGDocument
SB> in the following way :

SB> 1. SVGDocument svgDoc = JSVGDocument.getSVGDocument(); 2. Update
SB> it as necessary 3. JSVGDocument.setSVGDocument(svgDoc) - as a
SB> result the SVG view is updated.

SB> The problem is that JSVGDocument.setSVGDocument() causes the whole
SB> view redrawn, which takes few seconds. 

    I'm guessing you are using Batik 1.1.1 (you don't say).  If you
switch to Batik 1.5b4 (or better current CVS) when you modify the
document (which you must do in the update thread - search archives for
examples) the display will automatically be updated (and only the
regions that need to be).

SB> If I call repaint(), it has no effect.  Is there any way to cause
SB> JSVGDocument to redraw only those parts of SVGDocument which have
SB> really changed ?  Again, apologies if these questions have already
SB> been answered before.

    You might also have to tell JSVGDocument that it should treat the
document as dynamic (also search the archives) - normally it tells
this by checking if the document has a script element - if you do
everything in Java it can't tell that it is going to be dynamic.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to