This tips have helped me a lot to increase the performance:

http://blogs.silverlight.net/blogs/msnow/archive/2008/11/03/silverlight-tip-of-the-day-67-silverlight-performance-tips.aspx

In the article Mike mentiones Seema's presentation, that's a must see when
it comes to performance in animations in SL. Making your app
windowless=false and not having a transparent background would give you a
quick win, but it won't be something thawill change it from 80% usage to
1-2%.
Setting enable redraw regions to true can easily help you spot area that
areas that are not part of the animation, but where SL is still doing
some work.



On Mon, Sep 21, 2009 at 1:43 PM, John OBrien <[email protected]>wrote:

>  Ross, I used Jose Fajardo’s sprite concept from Remix to change a high
> cpu repeating animation to a simple sprite (set of frames in one image,
> repeating animation is just translate x).
>
> It may not be ideal but for me it took the animation down to 1-2% cpu.
>
>
>
> His blog is here, but I’m not sure if he ever posted about it:
>
> http://www.cynergysystems.com/blogs/page/josefajardo
>
>
>
> John.
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Ross Jempson
> *Sent:* Monday, 21 September 2009 12:06 PM
> *To:* [email protected]
> *Subject:* animation cpu usage
>
>
>
> Hi there,
>
>
>
> This is an old question I posted when the list was down.
>
>
>
> Does anyone have any suggestions as to how I can minimise cpu usage when
> using a storyboard/animation(s) that repeat constantly.
>
>
>
> To explain the scenario, I have a screen that has a background that sort of
> looks like a night sky.  There are say 100 little stars (the same png
> scattered around with various sizes).  I animate the opacity / ScaleX /
> ScaleY of a random png every 1 second to create a twinkling effect that
> keeps running the whole time you view the screen.
>
>
>
> The effect is very nice, however I notice it hogs the cpu.
>
>
>
> I have tried 2 implementations.
>
>
>
> In the first implementation I created a storyboard with 3 animations.  I
> created a timer that fired every 1 second, and on the fly set the animations
> to target one of the pngs randomly (stopping and starting the storyboard
> each time).   This was consuming on average 80% of my CPU.
>
>
>
> I created a second implementation to see if I could improve the situation.
> In the second implementation I decided to build up the storyboard in code up
> front.  I create 40 animations up front targeting random pngs, each with a
> begintime 1 second later than the previous and add them all to the one
> master storyboard.  I then just run that storyboard over and over.  However,
> this approach made no difference to the cpu being consumed.
>
>
>
> Cheers.
>
> _______________________________________________
> ozsilverlight mailing list
> [email protected]
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>


-- 
Miguel A. Madero Reyes
www.miguelmadero.com (blog)
[email protected]
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to