NSPropertyListSerialization/plutil bloat in Tiger vs Jaguar
NSPropertyListSerialization/plutil bloat in Tiger vs Jaguar
- Subject: NSPropertyListSerialization/plutil bloat in Tiger vs Jaguar
- From: Aaron Tuller <email@hidden>
- Date: Wed, 28 Dec 2005 02:35:50 -0800
Ok, this is bizarre...
We bundle some data with our application, it's very simple and way
back when we decided to go with the plist format since it was so
straight-forward and easy to write/read to. Our data has a root
dictionary with 931 arrays in it, each array having 999 booleans. so
something like
<dict>
<key>005</key>
<array>
<false/>
<false/>
<false/>
<false/>
<true/>
...
<false/>
<false/>
<false/>
<false/>
</array>
<key>006</key>
<array>
<false/>
<false/>
<false/>
...
To generate this plist, we read in a delimited text file, loop
through the records, create the dict, then write it out with the data
from this:
[NSPropertyListSerialization dataFromPropertyList:zipDict
format:NSPropertyListBinaryFormat_v1_0 errorDescription:&error];
i wrote a small tool to do this, and would run it on our input file,
it would create binary plists, all was good. So we have a new input
file today, i run it on Tiger (first time running the tool since
Jaguar days) and I get a huge file, it's 6.2 megs. On Jaguar, same
exact tool, same exact input file, it's 76k. I tried on Panther and
got the 6.2 meg file as well. I used plutil to convert both the
binary files to XML, and diff'd them and they are the same. Running
'plutil -convert binary1 thefile-xml.plist' on Tiger gives me a 6.2
meg file, same plutil command on Jaguar gives me a 76k file, from the
same XML file.
I tested our app with the 76k file and all seems well, but I'm
worried I'm missing something, especially since I don't plan to have
a Jaguar machine for ever, and bundling a 76k file vs a 6 meg file
with a 10 meg app is quite a difference. And what is all this extra
data?
I tried using NSKeyedArchiver and NSArchiver and they both made large
files as well. So in the meantime, I'm going to stick with my
Jaguar-made plist.
I can make sample code and input/output files available if you have
any thoughts. Ideally, I'd like to be able to make the smaller-style
binary plist in code from my tool.
Thanks!
-aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden