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 "frederik.santens@pandora.be" <fr...@telenet.be> on 2005/06/21 13:20:03 UTC

Optimize SVG for dynamic update

Hello,

We're building an application that updates an large SVG (< 8MB) every 2 seconds. The SVG contains a lot of static parts that makes the update process considerably heavier. 

Are there ways to optimize the SVG (structure, layers, ...) so that the updates take less CPU.

We use batik 1.5.1 on Windows 2000/XP. Updates are done via java (RunnableQueue)

Thx
Frederik



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


Re: Optimize SVG for dynamic update

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Frederik,

Frederik Santens wrote:
> We are trying to solve it by splitting the large SVG in 2 parts; one
> static part and one dynamic part. We layer the dynamic part on top of
> the static part so the updates will be done on small SVG.
> 
> Has anyone tried this before; suggestions are welcome:-)

    In general splitting the document should be pretty straight
forward.  What problems are you encountering?



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


RE: Optimize SVG for dynamic update

Posted by Frederik Santens <fr...@pandora.be>.
We are trying to solve it by splitting the large SVG in 2 parts; one
static part and one dynamic part. We layer the dynamic part on top of
the static part so the updates will be done on small SVG.

Has anyone tried this before; suggestions are welcome:-)

Frederik

-----Original Message-----
From: Lukasz Matuszczak [mailto:l.matuszczak@atrem.pl] 
Sent: Wednesday, June 22, 2005 7:29 AM
To: batik-users@xmlgraphics.apache.org
Subject: Re: Optimize SVG for dynamic update


----- Original Message ----- 
From: "frederik.santens@pandora.be" <fr...@telenet.be>
To: <ba...@xmlgraphics.apache.org>
Sent: Tuesday, June 21, 2005 1:20 PM
Subject: Optimize SVG for dynamic update


> Hello,
>
> We're building an application that updates an large SVG (< 8MB) every
2 
> seconds. The SVG contains a lot of static parts that makes the update
process 
> considerably heavier.
>
> Are there ways to optimize the SVG (structure, layers, ...) so that
the 
> updates take less CPU.
>
> We use batik 1.5.1 on Windows 2000/XP. Updates are done via java 
> (RunnableQueue)
>

I have the similar problem (although my documents are 10 times smaller
:)). I 
received an answer from Thomas that what I really need is 'static' CSS
hint from 
SVG 1.2.
look here:
http://koala.ilog.fr/batik/mlists/batik-users/archives/msg06866.html

It is not implemented in Batik so far.

I have tried also some workaround solution which puts several
JSVGCanvas-es, one 
above another. Static parts of document are presented in a one
JSVGCanvas, which 
is in the background and dynamic ones are put in JSVGCanvases with
transparent 
background. This solution gives you a big performance boost, because
static 
parts of document are rendered to an offscreen buffer only once. There
are 
however some complications, because it is important to set <svg>
viewbox, x, y, 
width, height attributes of top transparent layers properly, if we want
them to 
be a little smaller than bottom JSVGCanvas (each JSVGCanvas holds
offscreen 
buffer in memory, which can be big). Moreover if we want to cut some
fragment 
from the original document and put it in another JSVGCanvas, we have to
care 
about copy all CSS, fonts, symbols, gradients definitions.

Regards,
Lukasz Matuszczak 



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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 


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


Re: Optimize SVG for dynamic update

Posted by Lukasz Matuszczak <l....@atrem.pl>.
----- Original Message ----- 
From: "frederik.santens@pandora.be" <fr...@telenet.be>
To: <ba...@xmlgraphics.apache.org>
Sent: Tuesday, June 21, 2005 1:20 PM
Subject: Optimize SVG for dynamic update


> Hello,
>
> We're building an application that updates an large SVG (< 8MB) every 2 
> seconds. The SVG contains a lot of static parts that makes the update process 
> considerably heavier.
>
> Are there ways to optimize the SVG (structure, layers, ...) so that the 
> updates take less CPU.
>
> We use batik 1.5.1 on Windows 2000/XP. Updates are done via java 
> (RunnableQueue)
>

I have the similar problem (although my documents are 10 times smaller :)). I 
received an answer from Thomas that what I really need is 'static' CSS hint from 
SVG 1.2.
look here: http://koala.ilog.fr/batik/mlists/batik-users/archives/msg06866.html

It is not implemented in Batik so far.

I have tried also some workaround solution which puts several JSVGCanvas-es, one 
above another. Static parts of document are presented in a one JSVGCanvas, which 
is in the background and dynamic ones are put in JSVGCanvases with transparent 
background. This solution gives you a big performance boost, because static 
parts of document are rendered to an offscreen buffer only once. There are 
however some complications, because it is important to set <svg> viewbox, x, y, 
width, height attributes of top transparent layers properly, if we want them to 
be a little smaller than bottom JSVGCanvas (each JSVGCanvas holds offscreen 
buffer in memory, which can be big). Moreover if we want to cut some fragment 
from the original document and put it in another JSVGCanvas, we have to care 
about copy all CSS, fonts, symbols, gradients definitions.

Regards,
Lukasz Matuszczak 



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


Re: Optimize SVG for dynamic update

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Hi Frederik,

I don't believe that what you want to do is feasible with SVG/Batik. It 
would not be fast enough. 8MB is a fairly large size for SVG documents 
and would never load and render in <2 seconds, unless you have a very 
fast machine.

Andreas

frederik.santens@pandora.be wrote:

>Hello,
>
>We're building an application that updates an large SVG (< 8MB) every 2 seconds. The SVG contains a lot of static parts that makes the update process considerably heavier. 
>
>Are there ways to optimize the SVG (structure, layers, ...) so that the updates take less CPU.
>
>We use batik 1.5.1 on Windows 2000/XP. Updates are done via java (RunnableQueue)
>
>Thx
>Frederik
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>  
>


-- 
----------------------------------------------
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


RE: Optimize SVG for dynamic update

Posted by Benjamin Campin <bc...@dbxgeomatics.com>.
Hi Frederik,


Have you tried the client's script to update you SVG (getUrl, parseXML)
You will be able to update only dynamic parts.

I don't know if this is faster than server side (and I don't know what is
RunnableQueue)

My 2 cents,

Benjamin

-----Original Message-----
From: frederik.santens@pandora.be [mailto:frederik.santens@telenet.be] 
Sent: June 21, 2005 7:20 AM
To: batik-users@xmlgraphics.apache.org
Subject: Optimize SVG for dynamic update

Hello,

We're building an application that updates an large SVG (< 8MB) every 2
seconds. The SVG contains a lot of static parts that makes the update
process considerably heavier. 

Are there ways to optimize the SVG (structure, layers, ...) so that the
updates take less CPU.

We use batik 1.5.1 on Windows 2000/XP. Updates are done via java
(RunnableQueue)

Thx
Frederik



---------------------------------------------------------------------
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