PSTFoundationBenchmark
PSTFoundationBenchmark copied to clipboard
added NSSortDescriptor option sort time
NSSortDescriptor is much faster than any other sort method available in NSArray. Here is the results on my computer .
2014-01-08 23:20:31.112 PSTFoundationBenchmark[36326:907] Sorting 1000000 elements. selector: 6926.93[ms] function: 9356.48[ms] block: 5662.77[ms] sortDescriptor: 2650.73[ms].
Yes, you are right. The default is compare: and not localizedCaseInsensitiveCompare: Changing the selector to localizedCaseInsensitiveCompare: slows it to all the other sorting methods' speed with selector being the fastest.
There you go. If you update your PR using the selector I'll merge it. It's another option and also interesting.