Fast (de)serialization on iPhone

Posted by Jacob Kuypers on Stack Overflow See other posts from Stack Overflow or by Jacob Kuypers
Published on 2010-06-13T16:31:18Z Indexed on 2010/06/14 4:52 UTC
Read the original article Hit count: 220

I'm developing a game/engine for iPhone OS. It's the first time I'm using Objective-C.

I made my own binary format for geometry data and for textures I'm focusing on PVRTC. That should be the optimal approach as far as speed and space are concerned. I really want to keep loading time to a minimum and - if possible - be able to save very fast as well.

So now I'm trying to make my "Entity" stuff persistent without sacrificing performance.

First I wanted to use NSKeyedArchiver. From what I've heard, it's not very fast. Also, what I want to serialize is mostly structs made of floats with some ints and strings, so there isn't really a need for all that "object graph" overhead.

NSArchiver would have been more appropriate, but they kicked that off the iphone for some reason.

So now I'm thinking about making my own serialization scheme again. Am I wrong in thinking that NSKeyedArchiver is slow (I only read that, haven't tested it myself)? If so, what's the best way to encode/decode structs (with no pointers, mostly floats) without sacrificing speed?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c