Within the body of function Bio::PrimarySeqI::_find_orfs_nucleotide() there is the following loop:
for( my $j = 0; $j <= $seqlen-3; $j++ ) {
my $frame = $j % 3;
my $this_codon = substr( $sequence, $j, 3 );
...
}
The creation of $frame and $this_codon variables, especially for a large sequence is not optimal.
I propose the following optimization:
my ($frame, $this_codon);
for( my $j = 0; $j <= $seqlen-3; $j++ ) {
$frame = $j % 3;
$this_codon = substr( $sequence, $j, 3 );
...
}