Monday, October 13, 2014

NSCoder, NSArchiver, and NSKeyedArchiver


If I chain 40000 Foo objects together, all NSCoders crash on archiving, keyed or unkeyed, because of stack exhaustion. Surprising!


There are likely very few applications, where it pays off to use NSKeyedArchiver to cache an object graph. It’s neither a compact format, nor a fast coding method. You might be better off just reparsing the source. I parse my templates just about as fast as NSArchiver can unarchive. I can see where the added compression and the lack of need for extra I/O to read included files may give NSArchiver an advantage. NSKeyedArchiver though, just makes everything worse for me.

It looks like FastCoding is subject to the same stack limitation.

Comments RSS · Twitter

Leave a Comment