Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we improve the performance of our WPF Animations (100 of them)?

We have an application that generates around 100 animations at runtime and they are all added to a single storyboard and then played. The problem is that the animation is extremely slow. The objects that are being animated are shapes and splines and a good amount of computation is done in the backend for generating the custom splines. The running computer is a quad core with a good graphics card.

Any suggestions on how we can fix this? Do we need to split the animations into multiple storyboards or animate on different canvases?

Thank you

like image 305
user180812 Avatar asked Nov 06 '22 18:11

user180812


1 Answers

Its little difficult to know whats slowing down your animation without seeing animation and code. But I will give you general points that can help improving them.

  1. Move your calculation into different thread, if there is very heavy calculation. Dispatcher thread is busy doing your UI management so if you put everything into one thread that will certainly slow down things.
  2. Reuse your splines,shapes etc, this will certainly help you because you will also free your app from costly garbage collection routines. Infact before starting animation, display some different animation like clock etc to create all objects required in the beginning.
  3. Explore bitmap caching options and try to implement them.
like image 129
Akash Kava Avatar answered Nov 15 '22 07:11

Akash Kava