What are some possible optimizations for NSDateFormatter's stringFromDate?
I am currently profiling my iPhone application start-up in an attempt to get it to start as quickly as possible. In the first 19 seconds of my application being started I call NSDateFormatter开发者_Python百科's stringFromDate method 6 times with the following format string: @"h:mm a zzz"
The NSDateFormatter instance itself is shared by all calls and I only set the date format once, but those 6 calls to stringFromDate amount to 17.3% of my start-up CPU time.
Note: The dates are dynamic so I can't just save the strings.
Any suggestions as to how I could make this faster?
精彩评论