4

How to increase the downloading speed in an app using dispatch queue?

I am using dispatch queues to download images in my app but it takes time when it is downloading for the first time as after that I am storing them into cache. But I want to download them faster for the first time too.

Can anybody suggest me a way for this to use with the dispatch queues?

1
  • 1
    Do you have any notion of why the download is slow? Is it because there are may images to download, or because the images are large? I get the feeling that what you really want is to speed up the download, like when using a download manager in the browser (which splits each file in parts and downloads the parts simultaneously in separate threads, and then merges them back to one file)... Feb 12, 2014 at 8:04

2 Answers 2

5

In my opinion, you can use a queue with high priority and then the system will take a decision. I do not think you can do more with grand central dispatch

dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)

Use this queue to download operations.

Oficial Documentation

Queue isn't threads, system manages threads. You can use a queue with priority or concurrent queue (good idea Kyokook Hwang) and the system will decide the best performance.

1

If you want to increase downloading speed of each image, I have no idea to make it with GCD.
But, I think that you had better use a concurrent dispatch queue rather than a serial queue if you are using a serial queue to download them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.