分析 ActionScript-3 代码
有没有任何方法或工具可以在不使用 Flex 的情况下分析 AS3 代码?
如何分析用 Flash CS3 和 AS3 编写的现有项目?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Adobe 最近发布了一款名为 Adobe Scout 的新 Flash 分析工具:
http://gaming.adobe.com/ Technologies/scout/
它是一个独立的工具(您不需要 Flex/Flash Builder),并且可以与现有内容一起使用。 您可以分析您的 ActionScript 3 执行情况,它还向您显示有关 Flash Player 在幕后执行的操作的大量详细信息。 请注意,对于现有内容,您需要“选择加入”SWF 来获取有关 ActionScript 函数的数据 - 只需运行此
Scout 在试用期内免费 - 您只需注册一个免费的 Creative Cloud 帐户。 之后,将继续提供免费的基本版本,完整版本作为付费 Creative Cloud 帐户的一部分提供。
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.
我会推荐 Flash 大师 Grant Skinner 的性能分析器
http://www.gskinner.com/blog/archives/2009/ 04/as3_performance.html
I would recommend flash guru Grant Skinner's performance profiler
http://www.gskinner.com/blog/archives/2009/04/as3_performance.html
Flex实际上是一个框架。 我认为你的意思是 Flex Builder,它是一个包含内置分析器的 IDE。
它还取决于您想要分析哪些信息。 内存使用情况、CPU 性能、调用特定函数的次数……这些都是不同的指标。
对于内存,您可以使用 System.totalMemory 。 对于 Flash 来说,CPU 使用率并不像帧率(这是一种间接的 CPU 使用率指标)那么重要。 测量帧速率的方法有很多,但我通常在 Google 上搜索一个库,然后使用它。 类似于 Hi-ReS! 统计信息 或 AS3 SWF 分析器。 周围有数千个。
至于其他指标……你必须具体化。 如果您想找出诸如“哪个函数执行时间最长?”之类的信息。 那么你可能只需要亲自动手并将计时器放入你的代码中...... IOW 手动检测你的代码。
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.