Profiling ActionScript-3 Code

前端 未结 3 1634
失恋的感觉
失恋的感觉 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.

提交回复
热议问题