View Full Version : Maximum concurrent Loader.load() loads?
Tim John
October 16th, 2008, 01:18 PM
Hello all,
I have a class that loads a list of images in an XML file. The XML file can potentially contain any number of image URLs.
Would it be advised to call Loader.load() in a for each loop, causing every image to be loaded concurrently? Will there be a point at which the number of concurrent loads is too much for the system or the bandwidth, or does flash have some sort of intrinsic load management?
Thanks!
Tim
wvxvw
October 16th, 2008, 01:53 PM
This depends entirely on your browser capabilities, I would never load more than 1 at a time though.
Tim John
October 17th, 2008, 05:58 AM
Thanks,
I've added a property to my class that sets the number of concurrent downloads. In a test, I've found that 4 or 5 is a good number, and it's much faster than 1 at a time... I'd recommend doing this for anyone who wants faster loading times of external content.
scottc
October 17th, 2008, 06:39 AM
It would depend on your internet connection, and what other bandwidth using processes you have running...
Its pretty much the same thing as those "download accelerators"/managers or torrents with like 50 connections.
Sure you might get faster speeds, but so many connections can flood your connection leaving no bandwidth for your roommates etc and ultimately might not be the most optimal solution.
For generic web content, i'ld probably recommend about 1-3 connections... (mind you i am from Australia, and we have **** net connections, got 512k adsl).
wvxvw
October 17th, 2008, 07:01 AM
If you load more than 1 resource, then you risk to get "request timed out" response from your server, so, ideally you'll need to add listener to the status event and handle such status (i.e. reload the resource that did not load). But status event doesn't fire in all browsers...
Tim John
October 27th, 2008, 11:59 AM
Hmm, thanks for that advice. I have in some cases encountered what I think is a request timeout. And it was also undetected with a HTTPStatus event listener. What is one of those? Could I use an internal timeout in flash that reloads if no progress is received within a given period?
8bitninja
March 31st, 2010, 07:53 PM
Sorry about the thread necromancy here, but I have relevant data pertaining to this topic.
There is definitely an issue with loading too many things at once with separate Loader instances. This issue exists not only online with SWFs in browsers, but also local SWFs and projectors (CD-ROMs, on your LAN, or on a local drive).
I have a few rather complex Flash applications that use a large number of images that tend to need to be requested all at once.
Think of a large list of image URLs in XML. At first, I would run a loop on that list, instantiate a new Loader for each image URL and use the load method while still in the loop.
Even with all the appropriate loader error event listeners, occasionally I'd get images that would fail to load, but not error out in any way. This seemed to be a more common issue with projectors on CD-ROMs or on LANs, but did occur in any form Flash can be used.
The only way I could avoid this strange behavior is to limit the number of simultaneous Loader.load() calls. For a while, I made my applications download images one at a time. This completely got rid of any issues with images failing to load without any errors.
I do not think that is the best solution, however. Limiting yourself to one image at a time makes everything else seem to load a whole lot slower if one of the first images you need to load is a very large file size. I've not found the appropriate upper bound for number of concurrent Loader.load() calls, but I think 5-6 is safe. I know FileZilla limits itself to 10 maximum.
Has anyone else had issues similar to this?
What sort of solutions have you used?
Do you cache image results in some way, based on the image URL?
Has Adobe officially said anything about this?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.