{"id":9846,"date":"2014-10-13T10:51:39","date_gmt":"2014-10-13T14:51:39","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=9846"},"modified":"2014-10-13T11:13:57","modified_gmt":"2014-10-13T15:13:57","slug":"nscoder-nsarchiver-and-nskeyedarchiver","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/10\/13\/nscoder-nsarchiver-and-nskeyedarchiver\/","title":{"rendered":"NSCoder, NSArchiver, and NSKeyedArchiver"},"content":{"rendered":"<p><a href=\"http:\/\/www.mulle-kybernetik.com\/weblog\/2014\/10\/nscoder-surprisingly-fragile-n.html\">Nat!<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.mulle-kybernetik.com\/weblog\/2014\/10\/nscoder-surprisingly-fragile-n.html\"><p>If I chain 40000 Foo objects together, all NSCoders crash on archiving, keyed or unkeyed, because of stack exhaustion. Surprising!<\/p>\n<p>[&#8230;]<\/p>\n<p>There are likely very few applications, where it pays off to use <tt>NSKeyedArchiver<\/tt> to cache an object graph. It&rsquo;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 <tt>NSArchiver<\/tt> an advantage. <tt>NSKeyedArchiver<\/tt> though, just makes everything worse for me.<\/p><\/blockquote>\n<p>It looks like <a href=\"http:\/\/mjtsai.com\/blog\/2014\/08\/25\/fastcoding\/\">FastCoding<\/a> is subject to the same stack limitation.<\/p>","protected":false},"excerpt":{"rendered":"<p>Nat!: If I chain 40000 Foo objects together, all NSCoders crash on archiving, keyed or unkeyed, because of stack exhaustion. Surprising! [&#8230;] There are likely very few applications, where it pays off to use NSKeyedArchiver to cache an object graph. It&rsquo;s neither a compact format, nor a fast coding method. You might be better off [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[131,69,31,30,54,138,71],"class_list":["post-9846","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-cocoa","tag-ios","tag-mac","tag-objective-c","tag-optimization","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=9846"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9846\/revisions"}],"predecessor-version":[{"id":9849,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9846\/revisions\/9849"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=9846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=9846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=9846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}