Have you profiled this? The first thing I would to is run that in Instruments.

Georg


> Am 9. May 2020 um 14:44 schrieb Gabriel Zachmann via Cocoa-dev 
> <cocoa-dev@lists.apple.com>:
> 
> Again, thanks a lot for all the helpful hints.
> 
> Before restructuring my code, I did a few timings, using a set of test images 
> ranging in size from 30 through 300 MB.
> I used mach_absolute_time() for this experiment.
> And now, I am confused.
> 
> These are the execution times I have found for some of the methods that I 
> invoke in the process of loading and displaying the next image:
> 
> CGImageSourceCreateWithURL:         0.4-1.4 millisec
> CGImageSourceGetStatus:             10-600  microsec
> CGImageSourceCopyPropertiesAtIndex: 0.8-9   millisec 
> CGImageSourceCreateImageAtIndex:    15      microsec
> convertToNSImage (*):               25      microsec
> imgLayer.contents = nsimage:        1-5     microsec
> removeFromSuperlayer:               0.1     microsec
> addSublayer:                        5-10    microsec
> 
> (*): this is a wrapper method of mine that does a few calls to 
> CIImage/NSImage/NSCIImageRep methods.
> 
> Overall, none of the methods I invoke seems to incur a long execution time.
> Yet, there is a noticeable lag when my app switches from one image to the 
> next one.
> I can tell because all layers have an animation assigned.
> Sometimes , there is even a stutter in the animation itself.
> 
> But it doesn't seem like it makes sense at this point to load images in a 
> concurrent/background dispatch queue, does it?
> 
> So, I am confused: where is the lag coming from?
> 
> Any ideas how I might be able to prevent the lag/stutter when loading and 
> switching to big images?
> 
> 
> Best, G.
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to