Re: years:months:days:hours:minutes:seconds:sinceDate: really slow!
Re: years:months:days:hours:minutes:seconds:sinceDate: really slow!
- Subject: Re: years:months:days:hours:minutes:seconds:sinceDate: really slow!
- From: David Sinclair <email@hidden>
- Date: Wed, 21 Aug 2002 15:51:07 -0700
At 10:39 -0700 2002-08-21, Itrat Khan wrote:
I have not seen this performance problem and I use NSCalendarDate
extensively. Have you tried using hard-coded parameters, as in years:0
months:0 days:1 to see if the particular parameters you're using are
expensive? Alternatively, have you tried putting an NSLog in whichever
function is creating the date to see if you're calling it more often
than expected? Those are just a couple suggestions for tracking down the
performance hit because I it's likely not an issue with NSCalendarDate.
On further investigation I narrowed it down to the date calculations
within that method; passing zeroes for the years:months:days: parts
didn't exhibit the slowness, but passing non-zeros for any of those
did. There was no noticeable performance hit with the time
parameters. I would guess that that is due to heavy-duty
calculations to cope with leap years and other factors.
I ended up avoiding that method and using something simpler, which
doesn't have that performance hit.
Thanks for your reply.
--
David Sinclair - email@hidden
http://www.dejal.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.