Take the 2-minute tour ×

Hi SO :) I'm working with Flashpunk to make games 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!

share|improve this question
You're making the assumption (and you're not alone) that timing functions is the best way to find bottlenecks. There's a much better way. –  Mike Dunlavey Apr 17 '11 at 15:30
This is a great help, thanks for the link :) I need to figure out how to sample the call stack. –  capsid Apr 17 '11 at 18:44
You should be able to run under the flex debugger fdb, hit Ctrl-C, and type bt to get a backtrace. Possibly you would have to tell it how to handle a SIGKILL interrupt. –  Mike Dunlavey Apr 17 '11 at 20:26
add comment

5 Answers

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.

share|improve this answer
I think what I'm really after is the approach Mike Dunlavey links to above, thanks for the suggestion anway. –  capsid Apr 17 '11 at 18:45
add comment

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.

share|improve this answer
Thanks for the suggestion. I'm definitely not opposed to buying a professional tool to get access to neat features like Performance Profiling :) –  capsid Apr 17 '11 at 18:47
add comment

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.


share|improve this answer
Thanks for the suggestion. I'll try to refine my search for performance profilers. –  capsid Apr 17 '11 at 23:18
add comment

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.

share|improve this answer
add comment

Your Answer


