FROM : Austin Sarner
DATE : Sat Apr 02 08:05:01 2005
Hello all... here is my story,
I am writing an app that manages a large amount of information
in a hierarchical fashion. Originally, I had used custom classes and
implemented the NSCoding protocol methods to handle saving. This was
quick, simple, and produced decent enough results. But as time has
gone on I've been led to believe that if I used dictionaries for
everything I could simply call -writeToFile:atomically: and have a
nice, clean XML file as well as faster saving speeds - so I went
ahead and restructured everything around dictionaries. This however,
is not the case. The saved database using NSCoder took up a mere 5mb
and about 5 seconds to save, while the XML one took over a minute to
save, and weighed in at 265.1mb. Opening the file in TextWrangler
ensured that it had been properly constructed... but is there
something obvious I am missing - some simple way to drastically
improve the speed of writing dictionaries -- or perhaps even another
saving method that I have not explored? NSCoder works, but there are
applications that manage a lot more data than this and they don't
make you wait for a while every time you quit the program.
Thanks,
Austin Sarner
DATE : Sat Apr 02 08:05:01 2005
Hello all... here is my story,
I am writing an app that manages a large amount of information
in a hierarchical fashion. Originally, I had used custom classes and
implemented the NSCoding protocol methods to handle saving. This was
quick, simple, and produced decent enough results. But as time has
gone on I've been led to believe that if I used dictionaries for
everything I could simply call -writeToFile:atomically: and have a
nice, clean XML file as well as faster saving speeds - so I went
ahead and restructured everything around dictionaries. This however,
is not the case. The saved database using NSCoder took up a mere 5mb
and about 5 seconds to save, while the XML one took over a minute to
save, and weighed in at 265.1mb. Opening the file in TextWrangler
ensured that it had been properly constructed... but is there
something obvious I am missing - some simple way to drastically
improve the speed of writing dictionaries -- or perhaps even another
saving method that I have not explored? NSCoder works, but there are
applications that manage a lot more data than this and they don't
make you wait for a while every time you quit the program.
Thanks,
Austin Sarner
| Related mails | Author | Date |
|---|---|---|
| Austin Sarner | Apr 2, 08:05 | |
| Matt Neuburg | Apr 2, 18:29 |






Cocoa mail archive

