[Biococoa-dev] Optimizations

John Timmer jtimmer at bellatlantic.net
Tue Mar 15 15:45:09 EST 2005


Well, my work has paid off in an ironic way.  I cut about 1/4 off the time
for the strict search.  Unfortunately, I caught a bug in the non-strict
search (the first equivalence test only tested representations in one
direction, instead of in both).  Fixing that greatly increased the
comparisons done, which nicely doubled the time it took.

Sigh.  Anyway, I committed the changes, and left the previous version there
as slow_findSequence.  Maybe I should change that to
faster_buggier_findSequence?

Right now, about 1/4 the time is spent in the "representsSymbol" method,
querying arrays, so I'll look into finding a way to speed that up.

JT


> Incidentally, I've looked over the key method "findSequence" in the sequence
> finder, and I think it would be very easy to optimize this in some
> significant ways, at the expense of only a little readability.  A few of my
> ideas:
> We have several "if" conditionals inside tight loops - if we inverted things
> and put the conditionals outside the loops (which would cause some code
> repetition), we'd cut down on the code inside the loops substantially. I
> think we'd have to code 4 separate loops (only 1 of which would be used
> during a given method call).
> 
> We call to an external method - "compareSymbols" - within the loop.  The
> method's very short, so we could either move it inside the loop, or convert
> it to a static inline function (which essentially does the same thing).
> 
> In that method, we use a "isEqualToSymbol" operator between two objects in
> the case where we're looking at a strict comparison.  Since we're only using
> singletons for symbols, we could replace this with "==" and cut out the
> overhead of function calls.
> 


_______________________________________________
This mind intentionally left blank





More information about the Biococoa-dev mailing list