Working on a screen saver for my wife, http://cchearts.codeplex.com/, and while I've been able to improve FPS on lower end machines the CPU usage still seems very high.
Here's some numbers I ran from a few 5 minute sampling periods:
~60FPS 35% average CPU on Core 2 Duo T7500 @ 2.2GHz, 3GB ram, NVIDIA Quadro NVS 140M (128MB), Vista [My dev laptop]
~40FPS 50% average CPU on Pentium D @ 3.4GHz, 1.5GB ram, Standard VGA Graphics Adapter (unknown), 2003 Server [A crappy desktop]
I can understand the lower frame rate and higher CPU usage on the crappy desktop but it still seems pretty high and 35% on my dev laptop seems high as well.
I'd really like to analyze the application to get more details but I'm having issues there as well so I'm wondering if I'm doing something wrong (never profiled WPF before).
WPF Performance Suite:
Process Launch Error
Unable to attach to process: CCHearts.exe Do you want to kill it?
This error message occurs when I click cancel after attempting launch. If I don't click cancel it sits there idle, I guess waiting to attach.
Performance Explorer:
Could not launch C:\Projects2\CC.Hearts\CC.Hearts\bin\Debug (USEVISUAL)\CCHearts.exe. Previous attempt to profile the application finished unsuccessfully. Please restart the application.
Output Window from Performance:
Profiling started. Profiling process ID 5360 (CCHearts). Process ID 5360 has exited. Data written to C:\Projects2\CC.Hearts\CCHearts100608.vsp. Profiling finished. PRF0025: No data was collected. Profiling complete.
So I'm stuck wanting to improve performance but have no concrete way to determine where the bottleneck is. Have been relatively successful throwing darts at this point but I'm beyond that now :)
Summary:
Lot's of progress so far...
Performance Explorer
Problem: Wasn't working, vague error message.
Solution: Used the command line version to get a real error message that pointed me to this thread pointing out that it was a Symantec dll blocking me. Setting the following registry key fixed the problem:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysPlant]
"Start"=dword:00000004
WPF Performance Suite
Problem: Wasn't working, no error message.
Solution: Use the WPF Performance Suite designed for .NET 4 from the Windows SDK 7.1 instead of the previous version from Windows SDK 7 (I feel silly :-P)
WPF Animation
Problem: High CPU usage compared to FPS/percieved workload.
Solution: Lots ok tweaks here and there. But the HUGE improvement was Cached Composition as pointed out by Jeremiah Morrill. Check out the changesets.