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)
i also tried to load image via newly introduced CIImage with this 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 >= 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!");
without any luck... this single line
CIImage* cii = [CIImage imageWithData:imageData];
takes the same 300ms even on small images (4Kb png). imho, there is simple nothing to parse at all!
Is there anything to resolve such strange change in loading times? For now it looks like something changed drastically in sdk internals :(