Is there an ideal amount of network operations for the iPhone OS?

I use NSOperation and NSOperationQueue to process all of my network streams, so my interface can remain responsive when processing data over the Internet. I currently have my operations queue set up with a maximum of 5 simultaneous operations, and it seems to work well.

I am interested, however, if there is a more ideal number of concurrent network operations that best maximize available resources without clogging up the hardware. Are there any recommendations or steps that I can take to measure and clarify for myself?

+3
source share
1 answer

Given that the iPhone (currently) works with a single core, I would suggest that 5 is around the right number.

But the only way to be sure that it will be a tool and find out what the usage looks like (CPU, Memory and Network). Using a network that you could get based on the data transferred - but it's hard to know what rescaling is. I'm not sure if you can get CPU / memory statistics from iPhone.

If you do large translations, then more connections will probably not help. If you perform a large number of small transfers, then more connections will help you get around back and forth in setting up and disconnecting.

+1
source

Source: https://habr.com/ru/post/1710964/


All Articles