Descarga rápida usando la cola de despacho

How to increase the downloading speed in an app using cola de despacho?

Estoy utilizando colas de despacho 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?

preguntado el 12 de febrero de 14 a las 07:02

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)... -

2 Respuestas

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.

Respondido 12 Feb 14, 08:02

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.

Respondido 12 Feb 14, 07:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.