[Biococoa-dev] Profiling results
Alexander Griekspoor
mek at mekentosj.com
Fri Dec 3 12:06:57 EST 2004
John,
> Clocked in with the following with three repeats
> 2004-12-02 22:50:20.552 Translation[14076] time after translation:
> -8.624725
> 2004-12-02 22:50:30.823 Translation[14076] time after translation:
> -8.609338
> 2004-12-02 22:50:41.563 Translation[14076] time after translation:
> -8.681358
>
> Changing the part of BCSequenceFactory in question as follows:
> //aSymbol = (BCSymbol *)CFArrayGetValueAtIndex( (CFArrayRef)
> theContents,
> loopCounter);
> aSymbol = [theContents objectAtIndex: loopCounter];
>
> Clocked in as:
> 2004-12-02 22:55:25.098 Translation[14553] time after translation:
> -9.005473
> 2004-12-02 22:55:34.217 Translation[14553] time after translation:
> -9.083258
> 2004-12-02 22:55:46.097 Translation[14553] time after translation:
> -9.020712
>
> So, it's slower, but not much slower. In contrast, it is MUCH MUCH
> easier
> to read. So, in the future, I think it's safe to skip this unless
> you're
> doing multiple object lookups within a single loop.
Definitely! A lot of cocoa stuff (like NSArrays and CFArrays) can be
toll-free bridges, and I guess that's exactly what happens under the
hood, so I thought already that this wouldn't speed things up so much.
At the time the reason was really to get of the enumerator. Let's
indeed do it the readible way and reside to Core Foundation only when
we can get rid of a lot of object messaging (in terms of: really a
lot..).
Cheers,
Alex
*********************************************************
** Alexander Griekspoor **
*********************************************************
The Netherlands Cancer Institute
Department of Tumorbiology (H4)
Plesmanlaan 121, 1066 CX, Amsterdam
Tel: + 31 20 - 512 2023
Fax: + 31 20 - 512 2029
AIM: mekentosj at mac.com
E-mail: a.griekspoor at nki.nl
Web: http://www.mekentosj.com
The requirements said: Windows 2000 or better.
So I got a Macintosh.
*********************************************************
More information about the Biococoa-dev
mailing list