Thomas DeWeese wrote:
Jorg Heymans wrote:

What is the quickest way of either inserting a new node (say <g> with a bunch of paths) into a document or replacing an existing node ?

I have found that under similar circumstances, replaceChild() is about 10% quicker than appendChild(), but for my application it still takes about 5 seconds to dynamically add it.


   Sounds like it's a lot of geometry.  Do you know if the time is
taken in the add or in the repaint (you should be able to
print something after the add and then get a feel for when the
repaint finishes)?  BTW it is much better to do what you are doing and
add all the geometry at once.

Thanks for your feedback. Yes it is a GIS application, we've normalized the paths as much as we could but nevertheless they seem quite complex for batik. But nevertheless, it is strange that when i use setURI() to display my document it display a *lot* quicker.



BTW I'm surprised that there is any significant difference in the performance (I would suspect the difference is just noise - GC sneaking in or something).

You are right, i couldn't consistently reproduce the 10% difference so it must have been something like this.



   Yes, rendering time scales with the number of nodes.  Lots of
things, effect rendering time.  Filter effects, Complex fills
(patterns, gradients),  opacity (not so much stroke/fill opacity),
and text are probably the biggest offenders for Batik.

My paths are just plain geometries really, no fill, just lines. FWIW i have put a copy (115kb) on www.domek.be/batiktest.svg. The <g id="kreis"> is the element i am trying to insert dynamically.


Does the XML parser make a difference? I am using JDK 1.4.2 built-in Crimson. I'll see if i can do a test with latest Xerces.
Actually how about JDOM? Can it be used with Batik?


Regards
Jorg


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



Reply via email to