Profiling ActionScript-3 Code

前端 未结 3 1616
失恋的感觉
失恋的感觉 2021-01-06 14:34

Is there any way or tool available that can profile AS3 code without using Flex?

How can I profile existing project written in Flash CS3 and AS3?

相关标签:
3条回答
  • 2021-01-06 14:50

    Flex is actually a framework. I think what you mean is Flex Builder, which is an IDE containing a built-in profiler.

    It also depends on what information you want want to profile. Memory Usage, CPU performance, the number of times a particular function is called ... these are all different metrics.

    For memory you can use System.totalMemory. CPU usage is not really as important for Flash as framerate (which is an indirect CPU usage metric). There are many ways to measure framerate but I usually search Google for a library and then use it. Something like Hi-ReS! Stats or AS3 SWF Profiler. There are thousands of them around.

    As for other metrics ... well you have to be specific. If you want to find out things like "Which function is taking the longest amount of time to execute?" then you might just have to get your hands dirty and put Timers in your code ... IOW instrument your code by hand.

    0 讨论(0)
  • 2021-01-06 14:57

    Adobe have recently released a new profiling tool for Flash called Adobe Scout:

    http://gaming.adobe.com/technologies/scout/

    It's a standalone tool (you don't need Flex/Flash Builder), and it works with existing content. You can profile your ActionScript 3 execution, and it also shows you a lot of detail about what Flash Player is doing behind the scenes. Note that for existing content, you need to "opt-in" your SWF to get data about your ActionScript functions - just run this Python script on your SWF before profiling.

    Scout is free for a trial period - you just need to register for a free Creative Cloud account. After that, there will continue to be a free basic version, with the full version available as part of a paid Creative Cloud account.

    0 讨论(0)
  • 2021-01-06 14:59

    I would recommend flash guru Grant Skinner's performance profiler

    "Point it at an instance of a class, and it will test all the public methods on it. Or, use properties or parameters to formalize the tests with names, descriptions, and specific method lists.

    You can even use PerformanceTest to test the render time for complex vectors or filters.

    You can also easily customize how it logs the results of tests to output them differently, save them to a file, or graph the results.

    http://www.gskinner.com/blog/archives/2009/04/as3_performance.html

    0 讨论(0)
提交回复
热议问题