• 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: Improve performance of data structure saved to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improve performance of data structure saved to disk


  • Subject: Re: Improve performance of data structure saved to disk
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 06 Aug 2015 09:36:42 -0700

> On Aug 6, 2015, at 6:36 AM, Juanjo Conti <email@hidden> wrote:
>
> I've checked the number of entries and is only 350. They are regular
> cookies for well known sites like google, new relic, twitter...

With only 350 objects you should be fine using a ‘dumb’ archived dictionary. I’ve used that approach for several thousand objects that were more complex than cookies; this was on a Mac, but it was back in 2004 so it was probably slower than today’s iPhones ;-)

> I detect the performance issue using Instruments to mesure CPU time. The
> heaviest call from my call resulted to [CookieKey encodeWithCoder:]

That method should be pretty quick, so if it’s taking a lot of time there may be too many calls to it.

My guess is that you’re saving the ‘database’ to disk after every single change. That’s going to take O(n^2) time to add n entries, and I can believe it would be noticeably slow to add 350. Try doing what I said in my last message, using a time delay before saving.

—Jens
_______________________________________________

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: Improve performance of data structure saved to disk
      • From: Graham Cox <email@hidden>
References: 
 >Improve performance of data structure saved to disk (From: Juanjo Conti <email@hidden>)
 >Re: Improve performance of data structure saved to disk (From: Uli Kusterer <email@hidden>)
 >Re: Improve performance of data structure saved to disk (From: Juanjo Conti <email@hidden>)

  • Prev by Date: Re: Improve performance of data structure saved to disk
  • Next by Date: Re: Swift enums and NSNotificationCenter
  • Previous by thread: Re: Improve performance of data structure saved to disk
  • Next by thread: Re: Improve performance of data structure saved to disk
  • Index(es):
    • Date
    • Thread