[Biococoa-dev] Profiling results

John Timmer jtimmer at bellatlantic.net
Thu Dec 2 23:06:22 EST 2004


> I had the exact same problem yesterday. Did a clean target and rebuild,
> but still the same problem. Then I quit Xcode, and reopened the
> project, and it worked.... Very weird!
> 
That did the trick, thanks - should have thought if it myself.

Anyway, with the original code and an 11kb sequence, the following loop:
NSAutoreleasePool *thePool;
for ( loopCounter = 0 ; loopCounter < 100 ; loopCounter++ ) {
        thePool = [[NSAutoreleasePool alloc] init];
        theSequence = [theFactory createSequenceWithString: inputString
usingType: BCOtherSequence];
        [thePool release];
} 

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.  I do, however, now have
a DP machine at work, so I'll try it there and see if threading is an issue
for either of them (my bet would be no).


> 
> drwxr-xr-x  12 koen  koen     408  2 Dec 21:51 .
> -rwxr-xr-x   1 koen  koen   51861 26 Sep 17:23 .#project.pbxproj.1.26
> drwxr-xr-x  16 koen  koen     544 24 Nov 23:43 ..
> -rw-r--r--   1 koen  koen    6148 11 Nov 15:31 .DS_Store
> drwxr-xr-x   5 koen  koen     170  1 Dec 21:13 CVS
> -rw-r--r--   1 koen  koen  153334 21 Sep 20:05 drjay.pbxuser
> -rw-r--r--   1 koen  koen   43071 12 Sep 10:20 griek.mode1
> -rw-r--r--   1 koen  koen   95110 26 Sep 04:47 griek.pbxuser
> -rw-r--r--   1 koen  koen   42575  2 Dec 21:51 koen.mode1
> -rw-r--r--   1 koen  koen   95142  2 Dec 21:51 koen.pbxuser
> -rwxr-xr-x   1 koen  koen   26879 18 May  2004 mac.pbxuser
> -rwxr-xr-x   1 koen  koen   59177  2 Dec 21:51 project.pbxproj

Yeah, that's a bunch of our settings - build styles, window locations, etc.
If you're curious as to what it looks like, simply control-click on it and
view it as a text file.

Cheers,

JT

_______________________________________________
This mind intentionally left blank





More information about the Biococoa-dev mailing list