• 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: NSKeyedArchiver finishEncoding takes forever
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSKeyedArchiver finishEncoding takes forever


  • Subject: Re: NSKeyedArchiver finishEncoding takes forever
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 18 Jun 2008 13:59:32 -0700


On Jun 18, 2008, at 13:06, Markus Spoettl wrote:

I did profile it but it's not my code that is slow. It's the call to [archiver finishEncoding] that's taking so long (see the Shark trace below.

Regards
Markus

3.5% 57.0% CoreFoundation __CFSetFindBuckets2
2.6% 52.0% CoreFoundation __plistNumberEqual
4.0% 27.9% CoreFoundation CFEqual
1.1% 23.7% CoreFoundation __CFNumberEqual
10.3% 22.6% CoreFoundation CFNumberCompare
6.9% 11.9% CoreFoundation __CFNumberGetValue
3.8% 3.8% commpage [libSystem.B.dylib] __memcpy
...
4.9% 20.5% CoreFoundation CFNumberIsFloatType
15.6% 15.6% CoreFoundation CFNumberGetType

Yes, but look at where the time is *really* being spent. At a guess, finishEncoding is comparing every number object against every other number object to see if it can archive just one object of each distinct numeric value. With the number of objects you said you're using, this O(n**2) optimization -- if that's what it's doing -- is hideously expensive.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSKeyedArchiver finishEncoding takes forever
      • From: Markus Spoettl <email@hidden>
References: 
 >NSKeyedArchiver finishEncoding takes forever (From: Markus Spoettl <email@hidden>)
 >Re: NSKeyedArchiver finishEncoding takes forever (From: "Michael Ash" <email@hidden>)
 >Re: NSKeyedArchiver finishEncoding takes forever (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Rethinking my approach; rather overwhelmed.
  • Next by Date: Re: [Q] UTF-8 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding weirdness
  • Previous by thread: Re: NSKeyedArchiver finishEncoding takes forever
  • Next by thread: Re: NSKeyedArchiver finishEncoding takes forever
  • Index(es):
    • Date
    • Thread