Re: SVG in HTML Questions

On Sat, 26 Feb 2011 00:08:10 +1300, Tavmjong Bah <tavmjong@free.fr> wrote:

> Hi Alex,
>
> On Fri, 2011-02-25 at 09:48 +1100, Alex Danilo wrote:
>
>> >PS. Did I mention that SMIL is a resource hog?
>>
>> Yes you did.
>>
>> But, the statement is an observation and sweeping generalization.
>>
>> SMIL is not a resource hog - the implementations you have tested
>> with are clearly non-optimal. Any animation engine will chew all
>> the CPU if implemented naively. Frame rate control is important for
>> managing CPU hogging, as I'm sure the Flash folks are aware of as well.
>
> Of course you are right. On my Button test page, Firefox pegs the CPU,
> Opera and Chrome are a bit better. Obviously not as much thought has
> gone into the efficiency of SMIL implementations (compared to JavaScript
> implementations).

By coding animations declartively you give the user agent advance  
knowledge of what is going to happen (as opposed to a script where you  
basically don't know in advance at all) which is something that provides  
ample opportunity for optimizations.

> It doesn't appear that one can control the frame rate,
> relying on the implementations to do so.

Just go to:

     opera:config#SVG|TargetFramerate

Then put whatever target framerate you want. Also see  
http://dev.opera.com/articles/view/presto-2-2-and-opera-10-a-first-look/#fps.  
You can set it on a per-svg-fragment basis with script.

Cheers
/Erik

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Sunday, 27 February 2011 22:14:35 UTC