emineshn / breezemultitouch

Automatically exported from code.google.com/p/breezemultitouch
0 stars 0 forks source link

MTSmoothContainer high cpu load (patch included) #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The MTSmoothContainer can cause a high cpu usage because it applies transforms 
while they might not be needed, it also applies them when they're not even 
moving...

I used a profiler and noticed 99% of cpu time got into using updatePosition();
So I made a patch for it, simple but easy :)

it practically does the same effects as it normally does, but only applies the 
transforms when they actually transform something. When not touching anything 
this means the cpu usage is practically 0%.

I did
if(dRotPos != 0 || this.AngularDampingFilter.IsFiltering)
                transforms.Add(new RotateTransform(dRotPos, dCenX, dCenY));
not sure if that will always work out, but I couldn't find a real difference.

Anyway, source code is included!
I made an extra function addTransforms() to accept lists as well.

Original issue reported on code.google.com by WP.s...@gmail.com on 8 Dec 2011 at 2:25

Attachments:

GoogleCodeExporter commented 9 years ago
Great, thanks for that will check it out

Original comment by badbod99 on 9 Jan 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Can you please confirm which version you were using?

Original comment by badbod99 on 11 Jan 2012 at 4:43

GoogleCodeExporter commented 9 years ago
r65 from svn.
I was running this on a windows xp computer.

Original comment by WP.s...@gmail.com on 11 Jan 2012 at 4:46