Re: Excessive open gui graphics files on Mavericks
Re: Excessive open gui graphics files on Mavericks
- Subject: Re: Excessive open gui graphics files on Mavericks
- From: Uli Kusterer <email@hidden>
- Date: Wed, 09 Apr 2014 11:29:47 +0200
On 09 Apr 2014, at 07:22, email@hidden wrote:
> Base64 encode images into one file. It could even be an SQLite db file.
I’d recommend against base64-encoding possibly large binary data like image files. base64 makes it balloon in size. It’s fine for storing small binary bits like bookmark data (i.e. aliases) or NSDates in an Info.plist or XML file, but if there are enough images to cause running out of file descriptors, they are enough images that the overhead of base64-decoding will be relevant.
I worked on a project where we used to store a (comparatively small, ~700x500 pixels) preview of a JPEG file in a plist file as NSData. Even then we realized that decoding of this data was a big bottleneck for load times when showing a list of all these previews. We eventually switched to a separate image file and had a large benefit. Later when the previews needed to become larger, this saved our bacon. Given most common image formats these days are compressed already, anything beyond a tarball probably hurts more than it helps.
Now admittedly, we also gained the ability to not have to load the image file just because we needed some other key from the plist, but just moving the data from a hard disk over the bus can be a bottleneck, not even mentioning having to process each byte (and thus copying it again). Especially since that’s just to get the raw JPEG data, which is then decompressed and thus “copied” again.
Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de
_______________________________________________
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