Tools for profiling AS3, timing functions to find bottlenecks?
Hi SO :) I'm working with Flashpunk to make ga开发者_高级运维mes using Flex and FlashDevelop (highly recommended, amazing lib and IDE).
Since performance varies so much from system to system, I want to find where slowdowns are occurring and only fix those bits. Flashdevelop has a built in tool called Profiler, but it only shows the number of objects and the memory they are using, not the execution time. Grant Skinner wrote a great tool called PerformanceTest, but it seems suited to writing very specific optimization comparisons, not automatically profiling your code.
What I'm trying to find is a tool that will automatically analyze the program while it's running and tell me which functions are taking the longest to execute. I've heard that CS5 has this built in, but I'm wondering if there are any alternatives.
Thanks so much for your help!
You'll want to check out project Monocle [1][2][3]. It is available for public beta testing with limitation.
[1] http://www.bytearray.org/?p=4858
[2] http://inflagrantedelicto.memoryspiral.com/2012/10/using-advanced-telemetry-with-monocle/
[3] https://prerelease.adobe.com/callout/?callid=59A4F95D908A4D2FB9F302729FD0D87F
So, essentially you want to have a tool that tests all your functions for executions time automatically? Yeah, you're not going to find that.
You need to use test as mentioned with the 'PerformanceTest' tool that Grant has given you. You also need to write the test manually because there is no tool intelligent enough (short of Watson AI) that can write test cases for you. It's called unit testing and it's the only way to do performance testing on a function to function basis. Any large project should have some form of testing.
The FDT Profiler shows the execution time of methods if you use the "Performance Profiling" mode. Maybe the Flexbuilder profiler has a similar feature, but i'm not sure. For details on the FDT Profiler checkout this video.
There are primarily two types of profilers out there: Memory Profilers and Performance Profilers. It sounds like the you have used a Memory Profiler in the past, but what you are describing is called a Performance Profiler.
FlashBuilder Professional (not standard) has a Performance Profiler included. I have used it several times with quite a lot of success. @Mike Dunlavey's approach is nice if you don't have a tool, but I find that the metrics provided with a Performance Profiler are well worth the money, no matter what stack (not just the Flash platform) I am developing in.
B
Flash Builder has both a memory and a performance profiler built in, which sounds more or less like what you want.
If you just want a complete profile, start the program in profiling mode, do all standard tasks, then capture the performance profile. If you want to profile a specific task is to reset the data just before doing the action you want to do, do the action, then take the profile.
Unfortunately, it requires the Flash Builder Premium edition, but at least you can try it out before buying.
I guess it is pretty annoying to pay for an entire IDE, if you are only interested in the profiler, though.
精彩评论