如何提高Flex App的性能?
我正在开发一个 Flex 应用程序。该应用程序占据了 100% 的浏览器屏幕,但加载速度很慢。我应该如何提高性能,应该遵循哪些最佳技术来提高 Flex 应用程序的性能。
我确实尝试了一些东西,但我没有使用相对布局,而是使用绝对布局并将按钮/图像等放在画布中的确切位置,但我仍然觉得它很慢。我可以分析应用程序或弹性代码来查看应用程序执行时间最长的位置。
I am working on a flex application.The application occupies 100% of the browser screen, but it is slow to load.How should i improve the performance, what are the best techniques one should follow for improving the performance of a flex App.
I did try some stuff though, i am not using relative layout instead i am using absolute layout and putting the buttons/images etc at exact places in a Canvas, still i feel it is slow.Can i profile the App or flex code to see where exactly the app is taking the maximum time to execute.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Adobe 提供了一篇关于此主题的精彩文章:Flex 应用程序性能:改进的提示和技术客户端应用程序性能
Adobe offers a great article about this topic: Flex Application Performance: Tips and Techniques for Improving Client Application Performance
这里有一些很棒的资源,不仅可以提高 Flex 应用程序的性能,还可以提高 Actionscript 的总体性能:
总体而言,需要注意的一些关键事项总是这样做:
width="{something.other.width/4}"
)。导致调度一堆您可能不需要的事件。太多事件==太多临时对象==滞后。人们建议使用模块来减小 swf 大小并仅加载您需要的内容,但如果您的应用程序没有 CMS 那么大,则通常不需要它们。
Here are some great resources on improving performance of not only your Flex app, but of Actionscript in general:
Overall, some key things to always do:
width="{something.other.width/4}"
). Causes a bunch of events to be dispatched that you likely don't need. Too many events == too many temporary objects == lag.People recommend using Modules to decrease swf size and only load what you need, but if your application isn't as large as a CMS, you generally don't need them.
Flex Builder Professional 有一个内置的分析器,可以很好地分析您自己的代码。如果问题在于绘制性能和布局,那么它就没有那么有用(它可以很好地分析代码,但很难理解结果并以有用的方式将它们应用于代码中的更改)。
Flex Builder Professional has a built-in profiler that works pretty well for profiling your own code. If the problem is drawing performance and layout, it's not as helpful (it profiles the code just fine, but it's harder to understand the results and apply them in a useful way to changes in your code).