Re: MapKit overlay tip
Re: MapKit overlay tip
- Subject: Re: MapKit overlay tip
- From: Conrad Shultz <email@hidden>
- Date: Tue, 22 May 2012 13:15:07 -0700
On 5/22/12 12:52 PM, Alex Zavatone wrote:
> Just wanted to pass on this little pearl I just discovered in the
> case that it might help someone else.
>
> I've got a bunch of images that I'm using as mapKit mapView overlays
> for iOS devices and of course was interested in having them be as
> small as possible and load as fast as possible.
>
> So, I took all the PNGs and converted them to JPEGs at varying
> compression sizes and got them nice and small.
>
> Map drawing time went up terribly and the images and maps started
> slowly chunking in on the devices.
>
> Don't use JPEGs. Use PNGs. it's a world of difference in map
> drawing performance.
>
> Hope this tip/warning helps someone.
Note that as part of the build and bundling process, Xcode runs PNGs
through pngcrush, which does a variety of optimizations that reduce file
size and, I believe, do some hardware-specific decoding optimizations.
The upshot of this is that a comparison of raw PNG and JPG files is
totally meaningless; you would have to actually look at the
post-pngcrush output, and even this wouldn't tell the whole story.
If you are doing performance tuning, you should take a look at the
pertinent documentation (e.g.
https://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/PerformanceTuning/PerformanceTuning.html).
There and in other docs Apple explicitly notes that PNG is "the
preferred image format for iOS apps."
(Something I hadn't really thought about is that this would suggest
different performance for PNGs that are downloaded by an app versus
those that are included at build-time. Does anyone know whether there
is a noticeable difference?)
--
Conrad Shultz
Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden