Flex 加载时间非常糟糕,但仅限于非 Chrome 浏览器
我的 Flex 应用程序的加载时间非常糟糕(大约浪费了 5 到 8 秒),但仅对于 FF 和 IE,Chrome 看起来不错。
我已经确定在应用程序的初始化事件触发之前存在某种无用的空闲时间。这不仅仅是我的开发箱,它发生在任何地方。它在 Flash 版本、操作系统和浏览器版本之间也是一致的。我已经尝试过多次。 Chrome 始终运行得非常快,而 IE 和 FF 有这种奇怪的延迟。
然而在本地,无论是通过本地主机还是远程IP,都不存在这个问题。我相信你会认为这是下载时间的问题,但我的 SWF 非常小(400K),而且我特意制作了非常小的外部图像。我还通过 JavaScript 预取图像,firebug 报告稍后使用缓存。下载大小并不能真正证明等待时间的合理性。更不用说,为什么在 Chrome 中速度这么快? Chrome 下载图片和 SWF 文件真的那么快吗?
另外,Flex 调用了最少的 JavaScript,我或多或少排除了这个问题。所以这并不是 Chrome 对 JavaScript 的超快处理。
我没有看到 Firebug 的加载时间过长。我看到 JavaScript 在页面加载期间在浏览器中内联执行,但 SWF 中的应用程序 init 在大约 5 到 8 秒后不会触发。
我不明白为什么 Chrome 上的 Flash 速度这么快,也不明白 Flash 需要这么长时间才能启动。
编辑:尝试了 Flex Profiler,但在加载时间不佳后内存使用量激增。否则,我就不够了解或看到足够的信息来认识到其中的问题。
My flex application has a very bad load time (approx 5 to 8 wasted seconds) but only for FF and IE, Chrome appears fine.
I've determined there is some kind of useless idle time before the application's initalization event fires. This is not just my development box, it happens everywhere. It is consistent across Flash version, OS and browser versions too. I've tried multiple. Chrome consistenly works very fast, IE and FF have this strange lag.
However locally, whether via localhost or remote IP, it doesn't have this issue. I'm sure you'll think it is the download time, but my SWF is very small (400K) and I've purposely made external images that are very small. I also prefetch the images via JavaScript, and firebug reports the the cache is used later. The download size can't really justify the wait time. Not to mention, why is it so much faster in chrome? Is chrome really that fast downloading images and SWF files?
Also, minimal JavaScript is called from Flex, and I've more or less ruled out that is the issue. So it isn't Chrome's super fast handling of JavaScript.
I don't see any large load times with Firebug. I see JavaScript excute in the browser inline during a page load, but then the appliation init within the SWF doesn't fire for about 5 to 8 seconds later.
I don't see why flash on Chrome is so much faster, nor what could be taking so long for Flash to kick in.
EDIT: Tried the Flex Profiler, but memory usage spikes AFTER the bad load time. Otherwise, I don't know enough or see enough to recognize a problem with it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现,如果您使用 CSS 使 SWF 不可见,那么(无论出于何种原因)这些浏览器都会非常慢。我在加载页面/Flash 时正在执行此操作。
感谢大家的建议。
I figured it out, turns out (for whatever reason) these browser are very slow if you use CSS to make the SWF invisible. Which I was doing while the page/Flash loaded.
Thanks for the suggestions all.
尝试注释掉整个功能并查看问题是否仍然存在。如果没有,那么开始逐步取消注释,直到到达产生问题的部分。如果您无法弄清楚为什么该部分会产生不良影响,请发布一个包含具体细节的新问题。
Try to comment out the whole functionality and see if the problem persists. If not, then start progressively uncommenting things until you get to the part that produces the problem. If you can't figure out why that part is having the undesirable effects, post a new question with specifics.
听起来您在 FF 和 IE 中安装了调试 Flash Player。 Chrome 有自己的捆绑版本 Flash Player。这是正常行为,而且很好,因为您可以使用 Chrome 来查看用户将看到的内容,使用 Firefox 进行调试,使用 IE 来...帮助@mcandre QA 他的 HTML5 网站?
It sounds like you have the debug Flash Player installed in FF and IE. Chrome has its own bundled release Flash Player. This is normal behavior, and nice because you can use Chrome to see what your users will see, Firefox to debug, and IE to... help @mcandre QA his HTML5 websites?
请改用 HTML5。闪电侠是一只恐龙。
Use HTML5 instead. Flash is a dinosaur.