• 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: Fast NSArray compare
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast NSArray compare


  • Subject: Re: Fast NSArray compare
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 15 Apr 2014 10:42:51 -0700

On Apr 15, 2014, at 7:45 AM, Alex Zavatone <email@hidden> wrote:

> A good approach here would be to make a test case for NSArray and NSSet, a known set of files and simply test now long each takes.

In general I agree that it’s a good idea to test before optimizing. It’s common for people here to start obsessing over performance without even knowing whether the unoptimized code will take a measurable amount of time.

But in this case, there are enough red flags (scanning the filesystem, which often contains millions of files, and doing string comparisons against thousands of patterns), and using an NSSet instead of an NSArray is such an easy change, that I consider it a no-brainer to go with NSSet.

—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: Fast NSArray compare
      • From: "Gary L. Wade" <email@hidden>
References: 
 >Fast NSArray compare (From: Varun Chandramohan <email@hidden>)
 >Re: Fast NSArray compare (From: Graham Cox <email@hidden>)
 >Re: Fast NSArray compare (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Remove redundant AM/PM when formatting a time range?
  • Next by Date: Re: Fast NSArray compare
  • Previous by thread: Re: Fast NSArray compare
  • Next by thread: Re: Fast NSArray compare
  • Index(es):
    • Date
    • Thread