• 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: "Michael Ash" <email@hidden>
  • Date: Wed, 18 Jun 2008 17:41:04 -0400

On Wed, Jun 18, 2008 at 5:17 PM, Markus Spoettl
<email@hidden> wrote:
> On Jun 18, 2008, at 1:59 PM, Quincey Morris wrote:
>>
>> 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.
>
>
> Exactly and the test data isn't particularly big. Any ideas how to tell the
> archiver not to do this with my doubles (that doesn't involve conversion to
> strings and back)?

Although it partially defeats the purpose of using NSCoder, you'll
avoid this whole path if you stuff all four doubles into a single
NSData. Don't forget to use the byte-swapping functions to ensure that
they all have a consistent representation across architectures.

Mike
_______________________________________________

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>)
 >Re: NSKeyedArchiver finishEncoding takes forever (From: Quincey Morris <email@hidden>)
 >Re: NSKeyedArchiver finishEncoding takes forever (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: [Q] UTF-8 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding weirdness
  • Next by Date: Re: disappearing NSSpellingStateAttributeName
  • Previous by thread: Re: NSKeyedArchiver finishEncoding takes forever
  • Next by thread: Re: NSKeyedArchiver finishEncoding takes forever
  • Index(es):
    • Date
    • Thread