|
|
|
|
|
by stevoski
4675 days ago
|
|
A class like NSDateFormatter is designed to handle a wide range of date formats. This usual results in sub-optimal performance. If you find it too slow and you have a known, specific date format you should write a specific fast parser. I did the same with Java's Integer.parseInt(...) method. It is an interesting task to go through. Now I'll spend the rest of this rainy afternoon playing around with writing a fast ISO date parser :) Edit: Seems Java's Joda Time library already does parse ISO dates really quickly. 7 seconds for 4 million on my MBP Edit: A fast custom date parser for ISO dates I just wrote can parse 4 million dates in 150 milliseconds. |
|
Although I'm not sure how many people on iOS need millions of dates parsed.