• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dictionary Saving Horribly Slow!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dictionary Saving Horribly Slow!?


  • Subject: Re: Dictionary Saving Horribly Slow!?
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 02 Apr 2005 08:29:24 -0800

On Sat, 2 Apr 2005 01:05:01 -0500, Austin Sarner <email@hidden>
said:
>     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.

I'm surprised that you are finding XML saving slower: I had to switch to XML
saving because it was way faster. Specifically, I switched from
[NSKeyedArchiver archivedDataWithRootObject] to [NSPropertyListSerialization
dataFromPropertyList].

However, what I really suggest here is that you wait for Tiger, which is,
after all, going to be all about the very thing you're discussing. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
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

  • Prev by Date: Re: Progress Sheet
  • Next by Date: Re: Adding text in NSNumberFormatter string - 'e' not allowed?
  • Previous by thread: Dictionary Saving Horribly Slow!?
  • Next by thread: Weird console messages
  • Index(es):
    • Date
    • Thread