单个网页上有多个Flash对象?

时间:2021-11-24 20:55:48

Is there any significant performance/load time impact if single web page will load, say, 10 identical flash objects? 20? 30?.. any evidential data on sustainability of such kind of setup?

如果单个网页加载10个相同的flash对象,是否会对性能/加载时间产生重大影响? 20? 30?..关于此类设置可持续性的任何证据数据?

This would be the same flash app, each instance serving its own stream.

这将是相同的Flash应用程序,每个实例都提供自己的流。

4 个解决方案

#1


There's definitely going to be some overhead in size as there is a certain amount of code that is contained in every swf regardless of it's developer created content.

肯定会有一些大小的开销,因为每个swf都包含一定数量的代码,无论它是开发人员创建的内容。

I'm almost certain there would be speed issues as well, which would see frame rates drop right down the more swfs you add to the page.

我几乎可以肯定会出现速度问题,这会导致帧速率下降到您添加到页面的swfs中。

To be honest the concept smells a little fishy and i would think there must be a better solution to your problem.

说实话,这个概念闻起来有点可疑,我认为必须有一个更好的解决方案来解决你的问题。

EDIT

Also there is a restriction on having two steams coming over http per domain. Sure you could get around this but it will definitely be an issue.

此外,对于每个域有两个流过http的限制。当然你可以解决这个问题,但这绝对是一个问题。

#2


I found this post which might help. The trick is to use SWFObject to embed your swf files.

我发现这篇文章可能有所帮助。诀窍是使用SWFObject嵌入您的swf文件。

I ran into a strange problem today. On the music charts page on Muziboo, I was displaying a list of songs and a playlist on the right. Each song has a small button player done in OpenLaszlo. In firefox everything was fine and in IE (not unusually), the page would freeze for sometime. This would happen once and repeat only if I delete cache and try again. I googled a bit and learnt that it's a good idea to embed give each swf a unique id otherwise the browser misbehaves. I then went ahead and used swfobject to embed the swf files and everything started working great!

我今天遇到了一个奇怪的问题。在Muziboo的音乐排行榜页面上,我正在右侧显示歌曲列表和播放列表。每首歌都有一个在OpenLaszlo中完成的小按钮播放器。在Firefox中,一切都很好,在IE中(并非异常),页面会冻结一段时间。这将发生一次并且仅在我删除缓存并重试时才重复。我用Google搜索了一下,了解到嵌入每个swf是一个独特的id是个好主意,否则浏览器行为不端。然后我继续使用swfobject嵌入swf文件,一切都开始工作了!

#3


Yes, it'll likely nuke the browser if you go too far down that road.

是的,如果你走得那么远,那么它很可能会破坏浏览器。

If you want to deal in multiple streams, perhaps combining all your would-be applets into one giant one might work better. It'll certainly offset the serious overhead you'd have with 10-40 of the little blighters.

如果你想处理多个流,也许将所有你想要的applet组合成一个巨大的applet可能会更好。它肯定会抵消你对10-40个小战士的严重开销。

If this is a music player, you want to have a serious look at doing some JavaScript remoting. It's fairly trivial to control a flash app via JS so you could have standard HTML/CSS controls without having to load up a billion flash instances.

如果这是一个音乐播放器,你想要认真看看做一些JavaScript远程处理。通过JS控制Flash应用程序是相当简单的,因此您可以拥有标准的HTML / CSS控件,而无需加载十亿个闪存实例。

#4


Design-wise this just sounds like a bad idea. You'd be running multiple instances of the Flash player inside a browser, each of which has an individual cost, and the host (in this case the browser) will run all of them on the same thread (with the exception of certain elective asynchronous processes), so you're almost surely going to run into problems of various kinds -- jittery playback, UI blocking, processor burden, memory bloat, consequent instability of the host, etc.

设计方面,这听起来像个坏主意。您将在浏览器中运行Flash播放器的多个实例,每个实例都有单独的成本,主机(在本例中为浏览器)将在同一个线程上运行所有这些实例(除了某些选择性异步)过程),所以你几乎肯定会遇到各种问题 - 抖动播放,UI阻塞,处理器负担,内存膨胀,主机不稳定等等。

Unless the SWFs are very tiny, and doing very little work, it seems like a design that's just asking for trouble. Indeed you could test such a thing fairly easily; have you run any tests yet? Just curious.

除非主权财富基金非常小,并且做得很少,否则它似乎只是一种设计问题。事实上,你可以相当容易地测试这样的事情;你有没有进行任何测试?只是好奇。

Also curious as to the requirements; we might be able to offer more constructive alternatives if we knew a little more about what you were aiming for. Have you considered simply loading all the SWFs into a single container SWF requiring only a single browser-hosted instance of the Flash player?

对要求也很好奇;如果我们对你的目标有更多的了解,我们或许可以提供更具建设性的选择。您是否考虑过将所有SWF加载到单个容器SWF中,只需要一个浏览器托管的Flash播放器实例?

#1


There's definitely going to be some overhead in size as there is a certain amount of code that is contained in every swf regardless of it's developer created content.

肯定会有一些大小的开销,因为每个swf都包含一定数量的代码,无论它是开发人员创建的内容。

I'm almost certain there would be speed issues as well, which would see frame rates drop right down the more swfs you add to the page.

我几乎可以肯定会出现速度问题,这会导致帧速率下降到您添加到页面的swfs中。

To be honest the concept smells a little fishy and i would think there must be a better solution to your problem.

说实话,这个概念闻起来有点可疑,我认为必须有一个更好的解决方案来解决你的问题。

EDIT

Also there is a restriction on having two steams coming over http per domain. Sure you could get around this but it will definitely be an issue.

此外,对于每个域有两个流过http的限制。当然你可以解决这个问题,但这绝对是一个问题。

#2


I found this post which might help. The trick is to use SWFObject to embed your swf files.

我发现这篇文章可能有所帮助。诀窍是使用SWFObject嵌入您的swf文件。

I ran into a strange problem today. On the music charts page on Muziboo, I was displaying a list of songs and a playlist on the right. Each song has a small button player done in OpenLaszlo. In firefox everything was fine and in IE (not unusually), the page would freeze for sometime. This would happen once and repeat only if I delete cache and try again. I googled a bit and learnt that it's a good idea to embed give each swf a unique id otherwise the browser misbehaves. I then went ahead and used swfobject to embed the swf files and everything started working great!

我今天遇到了一个奇怪的问题。在Muziboo的音乐排行榜页面上,我正在右侧显示歌曲列表和播放列表。每首歌都有一个在OpenLaszlo中完成的小按钮播放器。在Firefox中,一切都很好,在IE中(并非异常),页面会冻结一段时间。这将发生一次并且仅在我删除缓存并重试时才重复。我用Google搜索了一下,了解到嵌入每个swf是一个独特的id是个好主意,否则浏览器行为不端。然后我继续使用swfobject嵌入swf文件,一切都开始工作了!

#3


Yes, it'll likely nuke the browser if you go too far down that road.

是的,如果你走得那么远,那么它很可能会破坏浏览器。

If you want to deal in multiple streams, perhaps combining all your would-be applets into one giant one might work better. It'll certainly offset the serious overhead you'd have with 10-40 of the little blighters.

如果你想处理多个流,也许将所有你想要的applet组合成一个巨大的applet可能会更好。它肯定会抵消你对10-40个小战士的严重开销。

If this is a music player, you want to have a serious look at doing some JavaScript remoting. It's fairly trivial to control a flash app via JS so you could have standard HTML/CSS controls without having to load up a billion flash instances.

如果这是一个音乐播放器,你想要认真看看做一些JavaScript远程处理。通过JS控制Flash应用程序是相当简单的,因此您可以拥有标准的HTML / CSS控件,而无需加载十亿个闪存实例。

#4


Design-wise this just sounds like a bad idea. You'd be running multiple instances of the Flash player inside a browser, each of which has an individual cost, and the host (in this case the browser) will run all of them on the same thread (with the exception of certain elective asynchronous processes), so you're almost surely going to run into problems of various kinds -- jittery playback, UI blocking, processor burden, memory bloat, consequent instability of the host, etc.

设计方面,这听起来像个坏主意。您将在浏览器中运行Flash播放器的多个实例,每个实例都有单独的成本,主机(在本例中为浏览器)将在同一个线程上运行所有这些实例(除了某些选择性异步)过程),所以你几乎肯定会遇到各种问题 - 抖动播放,UI阻塞,处理器负担,内存膨胀,主机不稳定等等。

Unless the SWFs are very tiny, and doing very little work, it seems like a design that's just asking for trouble. Indeed you could test such a thing fairly easily; have you run any tests yet? Just curious.

除非主权财富基金非常小,并且做得很少,否则它似乎只是一种设计问题。事实上,你可以相当容易地测试这样的事情;你有没有进行任何测试?只是好奇。

Also curious as to the requirements; we might be able to offer more constructive alternatives if we knew a little more about what you were aiming for. Have you considered simply loading all the SWFs into a single container SWF requiring only a single browser-hosted instance of the Flash player?

对要求也很好奇;如果我们对你的目标有更多的了解,我们或许可以提供更具建设性的选择。您是否考虑过将所有SWF加载到单个容器SWF中,只需要一个浏览器托管的Flash播放器实例?