如何优化 Flash/Actionscript 中的帧速率?

发布于 2024-09-04 18:58:54 字数 220 浏览 2 评论 0原文

我正在使用 Flash 资源在 Actionscript 中构建一个应用程序,当我尝试在屏幕上渲染 20 多个资源时,我的帧速率变得非常低 (~7 fps),即使这些资源中的大多数都是停止的影片剪辑。我尝试将 .cacheAsBitmap 设置为 true,这有一点帮助,但还不够。我还能做什么来提高帧速率?我注意到某些影片剪辑似乎比其他影片剪辑对其影响更大,但我不确定如何更改它们以使它们更容易渲染。

谢谢!

I'm building an application in Actionscript using Flash assets, and my frame rate becomes very low (~7 fps) when I attempt to render 20+ assets on the screen, even though most of those assets are stopped movie clips. I've tried setting .cacheAsBitmap to true, which helps a bit, but not enough. What else can I do to get the frame rate up? I've noticed that some movie clips seem to impact it more than others, but I'm not sure how to alter them to make them easier to render.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

内心旳酸楚 2024-09-11 18:58:54

很难猜测是什么导致屏幕上如此少量的资源出现速度减慢,但首先要检查是否存在内存泄漏或过多的内存使用情况。为了在调试项目时获得良好的 FPS/mem 显示,我推荐 MrDoob 的 Stats

如果确实如此没有发现任何明显的罪魁祸首,你需要更深入地挖掘,我发现的最好的工具(并在我自己的所有项目中使用)是 Grant Skinner 的 性能测试

It's hard to guess what could be causing the slowdown at such a small number of assets on screen, but the place to start would be to check for a memory leak, or excessive ram usage. To get a nice FPS / mem display while debugging your project, I recommend MrDoob's Stats

If that does not turn up any obvious culprits and you need to dig deeper, the best tool I've found (and use on all my own projects) is Grant Skinner's PerformanceTest

动次打次papapa 2024-09-11 18:58:54
  1. 通过垃圾收集,对侦听器使用弱引用。
  2. 分析您的应用程序是否存在内存泄漏,例如使用 FDT 4 Profiler 来确定是否存在泄漏。 Flash Builder 中也有类似的功能,请参阅使用探查器 。一周前发布了替代开源 PBLabsProfiler

从描述来看,好像是漏水了。

  1. Go through Garbage Collection, use weak references on listeners.
  2. Profile your app for memory leaks, e.g. use FDT 4 Profiler to determine if it's leaking. Similar functionality is there in Flash Builder, see Using the profiler. An alternative open-source PBLabsProfiler was released just a week ago.

By the description, it looks like it's leaking.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文