Skip to content

Instantly share code, notes, and snippets.

@bagelturf
Created May 8, 2013 20:54
Show Gist options
  • Select an option

  • Save bagelturf/5543576 to your computer and use it in GitHub Desktop.

Select an option

Save bagelturf/5543576 to your computer and use it in GitHub Desktop.
URLByAppendingPathComponent is 10x slower than URLByAppendingPathComponent:isDirectory:
Running Time Self Symbol Name
519.0ms 3.4% 1.0 -[NSURL(NSURLPathUtilities) URLByAppendingPathComponent:]
459.0ms 3.0% 0.0 -[NSURL getResourceValue:forKey:error:]
456.0ms 3.0% 0.0 CFURLCopyResourcePropertyForKey
454.0ms 2.9% 0.0 _FSURLCopyResourcePropertyForKey
2.0ms 0.0% 2.0 OSSpinLockUnlock$shim
2.0ms 0.0% 2.0 _FSURLEndResourcePropertyCacheAccess
1.0ms 0.0% 1.0 CFRunLoopGetCurrent
55.0ms 0.3% 0.0 -[NSURL(NSURLPathUtilities) URLByAppendingPathComponent:isDirectory:]
2.0ms 0.0% 1.0 -[__NSCFString hasSuffix:]
1.0ms 0.0% 1.0 objc_msgSend
1.0ms 0.0% 0.0 -[NSURL(NSURL) isFileURL]
@ylian
Copy link
Copy Markdown

ylian commented Oct 29, 2014

That helped. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment