用于分析 AS3、计时函数以查找瓶颈的工具?
你好,SO :) 我正在与 Flashpunk 合作,使用 Flex 和 FlashDevelop(强烈推荐,令人惊叹的库和 IDE)制作游戏。
由于系统之间的性能差异很大,因此我想找到发生速度下降的位置并仅修复这些位。 Flashdevelop有一个名为Profiler的内置工具,但它只显示对象的数量和它们正在使用的内存,而不显示执行时间。 Grant Skinner 编写了一个名为 PerformanceTest 的出色工具,但它似乎适合编写非常具体的优化比较,而不是自动分析代码。
我试图找到一种工具,可以在程序运行时自动分析程序,并告诉我哪些函数执行时间最长。我听说 CS5 内置了这个功能,但我想知道是否有其他选择。
非常感谢您的帮助!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
那么,本质上您想要一个工具来自动测试所有函数的执行时间吗?是的,你不会发现的。
您需要使用 Grant 提供的“PerformanceTest”工具进行测试。您还需要手动编写测试,因为没有足够智能的工具(除了 Watson AI)可以为您编写测试用例。这称为单元测试,它是在功能到功能的基础上进行性能测试的唯一方法。任何大型项目都应该有某种形式的测试。
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.
如果您使用“性能分析”模式,FDT 分析器会显示方法的执行时间。也许 Flexbuilder 分析器有类似的功能,但我不确定。有关 FDT Profiler 的详细信息,请观看此视频。
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.
主要有两种类型的分析器:内存分析器和性能分析器。听起来您过去曾使用过内存分析器,但您所描述的称为性能分析器。
FlashBuilder Professional(非标准)包含一个性能分析器。我已经使用过几次并取得了相当大的成功。如果您没有工具,@Mike Dunlavey 的方法很好,但我发现性能分析器提供的指标非常物有所值,无论我正在开发什么堆栈(不仅仅是 Flash 平台)
。B
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 内置了内存和性能分析器,这听起来或多或少像您想要的那样。
如果您只想要完整的配置文件,请在分析模式下启动程序,执行所有标准任务,然后捕获性能配置文件。如果您想要分析特定任务,请在执行您想要执行的操作之前重置数据,执行该操作,然后进行分析。
不幸的是,它需要 Flash Builder Premium 版本,但至少您可以在购买之前试用一下。
我想,如果您只对探查器感兴趣,那么为整个 IDE 付费是相当烦人的。
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.
您需要查看 Monocle 项目 [1][2][3]。它可用于有限制的公开 Beta 测试。
[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
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