We have an application on iPhone. This application displays 25 products per page/screen. The text items such as product name, price, discount, URL of the product image, etc of all the 25 products is downloaded from the server first.
After that we make 25 synchronous requests to download the 25 product images, one after the another. Each image is about 25KB in size and these are of size 300 by 400 pixels approximately and we only need 72 by 72 pixels size images for display on iPhone. We notice that it takes about 40 seconds to display one screen/page and this sort of performance is not good. So we are investigating how to increase the performance.
- Will the performance improve if we scale down the size of the images on the server to 72 by 72 pxiels.
- Also is it possible to download all 25 images from server to the iPhone? If so can you please share your approaches as to how to do that? We want to do this only if it can improve the performance.
1.if you resize them to 72×72 then you will a have smaller size to download in total so it’s faster.
2.for batching i don’t have a solution but you could try to make an asynchronous request for each file. while downloading put a temporary image(a logo or something). when the image is downloaded replace the temp image with the new one.
you can put the images in a cache in order not to download them every time.
for asynchronous download you can use ASIHTTPRequest(it also has a cache class).
if you do synchronous requests then your GUI will freeze until they are finished.