From: Michael M. <mic...@ma...> - 2005-07-29 00:11:31
|
On Jul 28, 2005, at 4:54 PM, Maxwell, Adam R wrote: >>> >>> >> >> It probably couldn't hurt, but the main reason I thought of it >> here was for easier handling of memory allocations - CF doesn't >> seem to use autorelease as much in the more handy functions. I'm >> not sure what the real effect of eliminating ObjC message overhead >> is in cases like this. >> > > I mentioned updateMetadata since it uses > dateWithNaturalLanguageString three times, so that's 3*N items when > loading a file...not pretty. > > It looks like we can get the beachball when opening tugboat.bib to > go away by using CFDateFormatter in updateMetadata, whereas it's ~4 > seconds with current CVS. That's a huge improvement, so we may > have to figure out how to use it in spite of the Jaguar users. Nice... But that won't be easy if the function just doesn't exist on Jaguar, unless we want to compile it separately for that system... if so, we could just #ifdef it out. #if JAG date = [NSDate dateWithNaturalLanguage...] #else date = CFCreate... #endif hmm... There is a way, but it's nasty. We can use low-level mach link calls to find the function in +initialize (or wherever's convenient), and if it's not there, we could set a flag to use NSDate but if it is there, we just save a pointer to the function and use the function through the pointer... So, it's really a big speedup, eh? :) I might be willing to hack this. Maybe there's even a nice way to write a general function that'll be a backwards-compatible helper function for other situations like this... -mike -- Michael McCracken mic...@ma... http://michael-mccracken.net/ |