Note that there are some explanatory texts on larger screens.

plurals
  1. POUIImage:imageWithContentsOfFile is 10 times slower in iOS 5.0
    primarykey
    data
    text
    <p>After simply recompiling our iPhone application on newly released iOS 5.0 SDK i faced strange problem - all UIImage:imageNamed (first call with actual image loading) and UIImage:imageWithContentsOfFile started to work 10 times slower than before. i managed to narrow problem down: this is the case only for jpeg and png files (not gifs!) and this is not because of file size. even straightforward loading of small 32*32 png takes around 300ms... compared to 30ms on older devices (checked on 3.1 and 4.3.5 with the exact same code)</p> <p>i also tried to load image via newly introduced CIImage with this code</p> <pre><code>WLLog(@"Data loading..."); NSData *imageData = [NSData dataWithContentsOfFile:path]; WLLog(@"CIImage creation..."); CIImage* cii = [CIImage imageWithData:imageData]; WLLog(@"CIImage creation ok..."); float scle = 1.0; #if __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 40000 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { scle = [[UIScreen mainScreen] scale]; } #endif CIContext *context = [CIContext contextWithOptions:nil]; UIImage* res5 = [[UIImage alloc] init]; WLLog(@"UIImage creation..."); [res5 initWithCGImage:[context createCGImage:cii fromRect:cii.extent] scale:scle orientation:UIImageOrientationUp]; WLLog(@"Done!"); </code></pre> <p>without any luck... this single line</p> <pre><code>CIImage* cii = [CIImage imageWithData:imageData]; </code></pre> <p>takes the same 300ms even on small images (4Kb png). imho, there is simple nothing to parse at all!</p> <p>Is there anything to resolve such strange change in loading times? For now it looks like something changed drastically in sdk internals :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload