xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steiner, Dominik" <Dominik.Stei...@gigatronik.com>
Subject AW: static patch
Date Wed, 05 Oct 2005 07:14:49 GMT
Thank you so much Andreas and Thomas!!! 

Only the tip with the transformation of the <g> brought down the cpu to 50%...

I will use the static attribute as soon as there is a release (not sure how to apply the patch)...

Thanks again for your great help...

Dominik

-----Urspr√ľngliche Nachricht-----
Von: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com] 
Gesendet: Mittwoch, 5. Oktober 2005 03:20
An: batik-users@xmlgraphics.apache.org
Betreff: Re: static patch

Thomas DeWeese wrote:

>>First of all, I got error messages when applying the patch.

>    This is probably bad. I'll see if I can update the patch.

   I've put up a new patch for trunk.

>>http://www.carto.net/papers/svg/navigationTools2/index.svg where I
>>applied batik:static="true" to the <g> element with the id
>>"mainMapGroup" - a group that contains a raster image and a path
>>element. That content is not subject to change, at least not while
>>dragging this group (with a transform),

   This is correct, and I can confirm that the static patch
is working.  There were a couple of problems, first is that
the Batik code wasn't using the 'ideal' image type which hurt
performance quite a bit on Windows.

   Second updating the coordinates takes a lot of time -
text in Batik is really painfully slow (commenting out the
'showCoordinates' in the mousemove handler gives a better
idea of the difference).

>> or while drawing a manaul zoom rectangle on that element.

   This is wrong the zoom rect is added as a child of the
'mainMapGroup' so the offscreen raster is recreated for each
change, greatly impacting performance (when a child of the
'static' element changes the raster is dumped and it is
recreated)

   I fixed this simply by creating another group that is
a child of the mainMapGroup that has no 'id' but does have the
'static' attribute and put the raster and path in it.  In
reality you would probably need to do more to properly support
the info overlays in the real thing.

>>The thing is, that on my system (SuSE Linux) I can't see any performance
>>differences while dragging the map content or drawing the zoom rectangle.
>>
>>Is that not a suitable situation for the static attribute or did simply
>>the patching not work?

   This sample isn't an ideal test of the static attribute as the
content is just a raster with one path.  The static attribute is
most useful when you have _lots_ of vector content.  Java2D is
very good a resizing raster data and drawing one path (even a complex
one) is very quick so there isn't much of an improvement available by
caching as rasters.  Adding something like hi-res contours or lots
of static text (stuff that would have been really painfully slow
before) should keep just about the same performance.

   Finally I'm guessing that they were added in an attempt to get
something working but the static attribute won't do anything on an
individual path or image element (there basically isn't any advantage to
caching a single element, so I only look for it on svg, g, & use -
image could be a win if it were SVG but I'm not worrying about that
yet).

>>
>>Thanks for any info on that topic,
>>
>>Andreas
>>
>>PS: I am now also testing on Windows, to see if there is any difference.
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message