[Biococoa-dev] BCSequenceFactory

John Timmer jtimmer at bellatlantic.net
Thu Dec 2 14:58:30 EST 2004


> 
> The last line (just from curiosity...) is a non-related question about the CF
> usage. I fully understand that an enumerator is slower than looping through an
> array by hand, my question is however would:
>    CFIndex loopCounter;
>   for ( loopCounter = 0 ; loopCounter < aLimit  ; loopCounter++ ) {
>             aSymbol = (BCSymbol *)CFArrayGetValueAtIndex( (CFArrayRef)
> theContents, loopCounter);
>             if ( aSymbol == nullSymbol )
>                 altCount++;
>      } 
> 
> be really faster than the cocoa equivalent:
>   int loopCounter;
>   for ( loopCounter = 0 ; loopCounter < aLimit  ; loopCounter++ ) {
>             aSymbol = [theContents objectAtIndex: loopCounter];
>             if ( aSymbol == nullSymbol )
>                 altCount++;
>      } 
> 
> I have my doubts.... (and it definitely looks better!)
> Cheers, 
> Alex 

When I did code profiling, the number of ObjC runtime calls went down,
without a corresponding increase in CoreFoundation.  My assumption is that
this would lower the total time a bit, but I¹ve not gone back and confirmed
that.  This looks like a great chance to test that, because I agree that the
readability of the later is much better.

Maybe I¹ll have info on that by tomorrow....

JT


_______________________________________________
This mind intentionally left blank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/biococoa-dev/attachments/20041202/9130576a/attachment.html>


More information about the Biococoa-dev mailing list