Hi,
I have extracted the essential code snippets.
In this case the interval is 1 second but 75% CPU usage (P4/1.5GHz), 
if I add more controls first cpu usage increaes and later the 
interval grows too.
But if I remove the background image, cpu usage is about 5%

I am using javaScript only for testing and to compare different 
viewers/platforms

Later I would like to build a windows application using compiled code 
in context of an "SVG viewer component" like eSVG, Mobiform,...

Regards Friedhelm




viTest.js
=========

var text;
var rect;
var anim_timer;

function OnLoad(evt)
{
        //anim_timer = setInterval("OnTimer()", 1000);
        anim_timer = setTimeout("OnTimer()", 1000);
}

function OnTimer()
{
        var id;
        var i;
        var symbol;
        
        for(i=1; i<=15; i++)
        {
                var RandVal = Math.random();

                // set with of rect by random value
                if (i<10)
                 id = "fill0" + i;
                else
                 id = "fill" + i;

                rect = document.getElementById(id);
                rect.setAttribute('width', RandVal*100);
  }
        setTimeout("OnTimer()", 1000);
}

viTest.svg
==========

<?xml version="1.0"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>

<svg width="100%" height="100%" preserveAspectRatio="xMinYMin" 
xmlns:xlink="http://www.w3.org/1999/xlink"; viewBox="0 0 1024 768" 
xmlns="http://www.w3.org/2000/svg"; onclick="1" onload="OnLoad(evt)">
   <script type="text/ecmascript" xlink:href="viTest.js" />
   <title>Test Performance      </title>
   <image fill="#111" stroke-opacity="1"  x="20" y="20" width="100" 
height="100" transform="matrix(10.2304,0,0,7.42512,-205.313,-
148.255)" xlink:href="Main.JPG" />
   <g id="N01_BAR" class="dynamic">
      <rect fill="#3333ff" stroke="#3333ff" id="fill01" x="202.45" 
y="3.71" width="96" height="16" />
      <rect fill="#3333ff" stroke="#3333ff" fill-opacity="0" 
id="frame" x="200.45" y="1.71" width="100" height="20" />
   </g>

....

   <g id="N15_BAR">
      <rect fill="#3333ff" stroke="#3333ff" id="fill15" x="202.45" 
y="702.63" width="96" height="16" />
      <rect fill="#3333ff" stroke="#3333ff" fill-opacity="0" 
id="frame" x="200.45" y="700.63" width="100" height="20" />
   </g>

</svg>



--- In svg-developers@yahoogroups.com, Mario Vernari <[EMAIL PROTECTED]> 
wrote:
> Hi Friedheim,
> I agree with Domenico.
> SCADA using SVG synopthics is my main job, since over 2 years.
> I have several examples of SVG's taking almost no CPU.
> 
> The worstest problem (I'd say "fault") of SVG is that you cannot 
control how 
> much the SMIL animation can eat CPU.
> So most of the time you have to manage the code (losing even lot of 
time) to 
> adjust animations so that the CPU is within acceptable margins.
> Don't refuse the Javascript+DOM animation: in many situations it 
would be 
> convenient.
> Cheers
> Mario
> 
> 
> 
> On Monday 21 February 2005 11:56, friedhelmeichin wrote:
> >  I am trying to build a scada mmi prototype with svg. For this I 
used
> >  a background image (1024x768 *.png or *.jpg file) and in 
foreground
> >  some simple dynamic controls like "led, bargraph, text, 
symbol,...).
> >  To get the dynamic behaviour, I used JavaScript and the DOM to 
change
> >  some attributes (text, color, visibility,...) of the controls 
once
> >  per second.
> >
> >  I work with IE+ASV to show this graphic. There I get a really bad
> >  performance (97% CPU usage, 3s interval instead of 1s), if I 
don't
> >  use the attribute image-rendering="optimizeSpeed" at the 
background
> >  image element.
> >  When I use "optimizeSpeed" performance is ok, but I am not sure, 
if
> >  the quality of the graphic is sufficient for a comercial product.
> >
> >  Is this a typical behaviour?
> >
> >  Are there other ways to increase performance?
> >
> >  I am looking forward to get response from anybody, who has some
> >  experience in this case.
> >
> >  Regards
> >  Friedhelm
> >
> >
> >
> >
> >
> >  -----
> >  To unsubscribe send a message to:
> > [EMAIL PROTECTED] -or-
> >  visit http://groups.yahoo.com/group/svg-developers and 
click "edit my
> > membership" ----
> >
> >
> >
> >  Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/svg-developers/
> >  
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >  
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to