[Bioperl-l] 65% speedup for Bio::SeqIO::fasta::next_seq test

Aaron J Mackey Aaron J. Mackey" <amackey@virginia.edu
Mon, 30 Sep 2002 23:14:44 -0400 (EDT)


On Mon, 30 Sep 2002, Matthew Pocock wrote:

> Is this the sort of thing that would be greatly helped by using the
> inline module?

No, it has to do with the fact that the subroutine will, on average, be
called NlogN times for the sort, when the return value of the subroutine
is presumably constant (i.e. $location->start); in these cases, the
"Schwartzian transform" will be much more efficient (call the subroutine N
times and build an array ref of [ $object, $function_result ] and sort by
$a->[1] <=> $b->[1] then deref $_->[0]).

-Aaron

-- 
 Aaron J Mackey
 Pearson Laboratory
 University of Virginia
 (434) 924-2821
 amackey@virginia.edu