I have seen the Profile Window in Flash builder, but it shows 开发者_运维问答data only useful for memory profiling. How can we do CPU profiling for applications?
One of my UI operations is very CPU intensive and I need to profile to see which function calls are taking the most CPU cycles. Currently I am unable to find something like that.
Try using Monster Debugger. Its great for runtime debugging and cpu profiling. http://demonsterdebugger.com/ I use it all the time for swfs and air apps.
The random-pausing method should find your problem. All it requires is that you have a debugger that you can pause and show stack traces. Flex appears to have such a debugger, fdb.
From what I know, that's currently impossible to know because of the abstraction between actionscript and the Flash Player. Best bet would be to have a test run the function a few hundred thousand time and look at the OS' CPU monitor to check how much CPU it uses.
Frankly, I never really do this because I prefer to go over my code and find bottlenecks and improve them. If anything, I do unit tested and check the time it takes, then try to optimize it.
精彩评论