Hi Thomas,
Thanks for the response. I did a poor job of describing my problem. I
actually meant moving the layers within the document or changing their
rendering order. For example, sometimes a layer with certain elements
needs to appear on top or below another layer. I tried a couple of
approaches for moving the layers in the document, but I'm hoping there
is a more efficient method. Here's what I've tried:
-I used shell sort to move the layers to their destination
with documentRoot.insertBefore(priorityLayer, siblingLayer)
*the worst case senario took about 30 sec to render
-Currently, I'm just cloning the document, making my changes,
and reloading the document on the canvas.
*this worst case senario takes about 6 sec
Thanks again for your help!
Thomas DeWeese wrote:
Hi Greg,
Greg wrote:
I'm evaluating Batik for use in a basic floorplan/CAD application,
but I've stumbled into some performance issues (system & svg details
below). Initial rendering performance is good; I've clocked the GVT
build cycle around 6 sec. The problem arises when I try to move
layers around on the canvas. Moving one layer at a time is fine, and
it takes a few seconds. But one of the application's requirements is
to move many layer at a time to provide a different view of the
drawing. This was taking anywhere from 15 to 30 sec depending on how
many layers there were to move and how close they were to their new
position.
How are you moving the layers? Are you simply adding/updating
a transform attribute on the layer's group or are you trying to
modify every path element?
There is also the option to put each layer in a 'transparent'
canvas. If you did this Batik would cache each layer as a raster
so moving a layer would be really fast. I've also done some work
in implementing the 'static' property from SVG 1.2 which would allow
you to indicate that the rendering engine should cache each layer
in the document as a raster.
Generally, I'm concerned because my development machine is a decent
machine, and many of my users are certainly going to have lesser
machines. Is Batik a good solution for large sized CAD files or
would performance be better using other tools? Thanks for helping
with my problem!
During a rendering cycle the majority of the time is spend in
the rendering calls, so with Java you are unlikely to do much better
than Batik, and many will do worse as Batik's update engine is fairly
well optimized, on the flip side Batik needs to support 'general'
drawing so a totally focused application could potentially do better.
My Setup:
*Athlon 64 3000+ with 1GB of ram
*Java JDK1.5
*Batik 1.6
SVG File Description:
*Approx. 4Mb not compressed
*Structure
-drawing elements are grouped by layer
-a complex layer can contain about 15,000 lines (7,500 shape
elements; 7,500 group elements)
-each shape has its own group nested under a layer because a shape
can have other elements associated with it
-Example layout... <g opacity="1.0" id="Layer1"> <g
id="G1_L1">
<line .../>
<circle ... />
</g>
<g id="G2_L1">
<line .../>
<circle ... />
</g>
........many more elements......
<g>
<g opacity="1.0" id="Layer_2"> <g id="G1_L2">
<line .../>
<circle ... />
</g>
<g id="G2_L2">
<line .../>
<circle ... />
</g>
........many more elements......
<g>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]