• 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: Why not use path-based API? (was: Loading image resources)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why not use path-based API? (was: Loading image resources)


  • Subject: Re: Why not use path-based API? (was: Loading image resources)
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 14 Sep 2014 13:00:08 -0700

Performance is another reason. IIRC, in earlier OS X releases it turned out that there was significant overhead stemming from converting between different types of file references as a call went up and down the stack — NSString/CFString <—>NSURL/CFURL <—> FSRef <—> C strings, etc. (This may sound trivial, but it's the kind of trivial thing that can eat up CPU time inside loops or performance-critical code.) So there's been some effort to standardize on NSURL/CFURL, at least above the POSIX/kernel layer.

So I don't have numbers to back this up, but my understanding is that NSURL-based APIs will be slightly faster than NSString-based ones. Though probably not enough faster to worry about unless your code is performance-sensitive.

—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


References: 
 >Why not use path-based API? (was: Loading image resources) (From: Aandi Inston <email@hidden>)
 >Re: Why not use path-based API? (was: Loading image resources) (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Loading image resources
  • Next by Date: Re: Disable document save alert when closing inspector panel
  • Previous by thread: Re: Why not use path-based API? (was: Loading image resources)
  • Next by thread: Re: Why not use path-based API? (was: Loading image resources)
  • Index(es):
    • Date
    • Thread