how many network.requests can I send per scene before getting laggy?

Dear corona community,

working on my app where I up- and download multiple images raised the following question: Is there - roughly - a number of network.requests I can send in one scene before it gets laggy? I am aware you can not say something like “up to 10 is fine, but 11 is not”, but has anybody had any experience with downloading multiple images at once?

In one of my scenes I’d like to display profile pictures of other users who have liked or disliked something. Lets say these profile pictures are about 50kb in size. Could I go through a i=1, i<100 loop and fire 100 requests? Or would that be too much and something like showing only the last 10 likers is necessary?

Any hints / ideas are appreciated. Thank you

Hi mate,

I suspect that comes down to the internet bandwidth available unless you plan on going bananas :slight_smile:

I’d run some test and see where i land but plan for limited bandwidth, if you want a larger user base.

Anaqim

The limitation will than likely be that of the receiving server.  

If you are returning Facebook profile pictures then Facebook will limit requests like that so ensure you always cache downloaded resources and reference locally where possible and I would say limit to top 10 for sure.

If this is your own server then if you must have a crazy amount of small pictures then some logic on your server to batch into an imagesheet would perform far better and be a lot more efficient

anaqim: Thank you sir. Apart from bandwidth problems, could I run into corona-made problems like having to many requests at once? In other words: Let’s say I am fine with images appearing one after the other after scene is already on the screen: Do you know of any recommendations regarding max number of requests?

Sphere Game Studio: You’re becoming my support member no. 1 here, thank you sir :slight_smile:

It is my own server and I thought about creating imagesheets. Problem though is that at the end of the day there is like hundreds of different groups changing all the time. So not really an option, but I might have to look into that. Right now I have no idea how long it would take on serverside to create an imagesheet out of ~100 small images.

Storing them in devices doc dir is definitely an option and every time I need them, I check whether they are already there. Only consideration here is that the profile pictures can change from time to time (whenever other users decide to change it) and I havent really figured out what the best option would be to update them on the device then.

100 async requests should be fine if you fire them on a 10ms timer.  More of an issue will be handling the responses in a single event callback.

As I said the problem will be the server. 1 client fires 100 requests is OK, but 10 clients or 100 clients?

For example, Facebook will limit API calls to 200 per user per hour.

Thanks your your input, appreciate it. Guess I’ll start with limiting the number to something like “the last 10 people…” and then check out the creation of image sheets with JAVA. Question can be considered as answered :slight_smile:

Hi mate,

I suspect that comes down to the internet bandwidth available unless you plan on going bananas :slight_smile:

I’d run some test and see where i land but plan for limited bandwidth, if you want a larger user base.

Anaqim

The limitation will than likely be that of the receiving server.  

If you are returning Facebook profile pictures then Facebook will limit requests like that so ensure you always cache downloaded resources and reference locally where possible and I would say limit to top 10 for sure.

If this is your own server then if you must have a crazy amount of small pictures then some logic on your server to batch into an imagesheet would perform far better and be a lot more efficient

anaqim: Thank you sir. Apart from bandwidth problems, could I run into corona-made problems like having to many requests at once? In other words: Let’s say I am fine with images appearing one after the other after scene is already on the screen: Do you know of any recommendations regarding max number of requests?

Sphere Game Studio: You’re becoming my support member no. 1 here, thank you sir :slight_smile:

It is my own server and I thought about creating imagesheets. Problem though is that at the end of the day there is like hundreds of different groups changing all the time. So not really an option, but I might have to look into that. Right now I have no idea how long it would take on serverside to create an imagesheet out of ~100 small images.

Storing them in devices doc dir is definitely an option and every time I need them, I check whether they are already there. Only consideration here is that the profile pictures can change from time to time (whenever other users decide to change it) and I havent really figured out what the best option would be to update them on the device then.

100 async requests should be fine if you fire them on a 10ms timer.  More of an issue will be handling the responses in a single event callback.

As I said the problem will be the server. 1 client fires 100 requests is OK, but 10 clients or 100 clients?

For example, Facebook will limit API calls to 200 per user per hour.

Thanks your your input, appreciate it. Guess I’ll start with limiting the number to something like “the last 10 people…” and then check out the creation of image sheets with JAVA. Question can be considered as answered :slight_smile: