You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Steiner, Dominik" <Do...@gigatronik.com> on 2005/10/04 11:43:25 UTC
Performance problem
Hi there my dear friends,
I'm having a performance problem with my batik application. Basically
I'm doing as follows:
1) I'm having a big svg-map file (600KB) which I load one time
into my SVGCanvas
2) I'm displaying around 100 GPS points (which consists of a <g>
that contains a circle- and a text-element) on this map
3) Then at intervals of 500 ms I'm doing an update of the GPS
points
4) The CPU is running at around 90% all the time
5) When I just display the GPS points as circles-elements it
brings the CPU down to around 40%
So can it be that just adding an additional text-element can cause such
an decrease in performance? What are the 'tricks' that help to save
performance?
Thank you so much for any help and hints...
Dominik Steiner
Re: Performance problem
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi all,
Andreas Neumann wrote:
> I would also try to change the update interval.
>
> It is also clear that drawing text elements is more expensive than
> drawing circles. Rendering text elements, as I understand, is adding
> several polygons. After all, with text you are rendering polygons, at
> least with SVG fonts. I don't know if Batik uses different methods to
> render text that is installed in the system.
For 'system' fonts we draw a glyph vector which is supposed to be
the highest performance method, but we tweak the contents significantly,
so I don't know if this turns off any/all of the internal optimizations.
In general I suspect that it is more or less just drawing the text as
lots of small geometry.
The other aspect of the text that will cause a significant
performance impact is the simple fact that it needs to update a larger
region for each circle that changes.
> Also the extra "<g>" element decreases performance. If you don't really
> need the g-element you could omit it.
Actually for something like this the 'g' probably helps, it would let
us 'cull' the group. Also if he isn't already he should be moving
the circle and text by updating the transform on the 'g' element
rather than say updating 'cx', 'cy' on the circle and the 'x' & 'y'
on the text. I suspect with his performance he is already doing
this, if not it should be a fairly large performance gain.
> Maybe the newly introduced "static" patch would help (see
> http://issues.apache.org/bugzilla/show_bug.cgi?id=36627) could help as
> well? Maybe if you set the static attribute on the background map?
> Thomas, any comment on that? I yet have to test the "static" patch.
> Didn't have the time so far.
Yes, this is exactly the purpose of the static patch. In his case
if he were updating the transform on the group he could even tag his
'g' as static as well as the large map and the whole draw would devolve
to sprite blitting, perhaps with everything staying on the graphics card
(assuming the text on the circles doesn't change with each update, - say
to include the coords or something).
> Steiner, Dominik wrote:
>
>> Hi there my dear friends,
>>
>> I’m having a performance problem with my batik application. Basically
>> I’m doing as follows:
>>
>> 1) I’m having a big svg-map file (600KB) which I load one time into my
>> SVGCanvas
>>
>> 2) I’m displaying around 100 GPS points (which consists of a <g> that
>> contains a circle- and a text-element) on this map
>>
>> 3) Then at intervals of 500 ms I’m doing an update of the GPS points
>>
>> 4) The CPU is running at around 90% all the time
>>
>> 5) When I just display the GPS points as circles-elements it brings
>> the CPU down to around 40%
>>
>> So can it be that just adding an additional text-element can cause
>> such an decrease in performance? What are the ‘tricks’ that help to
>> save performance?
>>
>> Thank you so much for any help and hints…
>>
>> Dominik Steiner
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Performance problem
Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
I would also try to change the update interval.
It is also clear that drawing text elements is more expensive than
drawing circles. Rendering text elements, as I understand, is adding
several polygons. After all, with text you are rendering polygons, at
least with SVG fonts. I don't know if Batik uses different methods to
render text that is installed in the system. Also the extra "<g>"
element decreases performance. If you don't really need the g-element
you could omit it.
Maybe the newly introduced "static" patch would help (see
http://issues.apache.org/bugzilla/show_bug.cgi?id=36627) could help as
well? Maybe if you set the static attribute on the background map?
Thomas, any comment on that? I yet have to test the "static" patch.
Didn't have the time so far.
Andreas
Steiner, Dominik wrote:
> Hi there my dear friends,
>
> I’m having a performance problem with my batik application. Basically
> I’m doing as follows:
>
> 1) I’m having a big svg-map file (600KB) which I load one time into my
> SVGCanvas
>
> 2) I’m displaying around 100 GPS points (which consists of a <g> that
> contains a circle- and a text-element) on this map
>
> 3) Then at intervals of 500 ms I’m doing an update of the GPS points
>
> 4) The CPU is running at around 90% all the time
>
> 5) When I just display the GPS points as circles-elements it brings
> the CPU down to around 40%
>
> So can it be that just adding an additional text-element can cause
> such an decrease in performance? What are the ‘tricks’ that help to
> save performance?
>
> Thank you so much for any help and hints…
>
> Dominik Steiner
>
--
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093 Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org