in reply to Equation - code review
Does it work against your test suite?
Update
Why &alpha_index({...?
Why my $self=... when alpha_index doesn't seem to be a method?
Why my ($left,$middle,$right when they are used locally to the foreach (@carbon_index is correctly declared)
Why the assignment in my %carbon_aa=(); when it is empty to start with anyway?
Why my ($left_aa,$right_aa,$distance_index,$power)=0; when only $left_aa gets a value?
Why are $left_aa,$right_aa,$distance_index,$power not declared local to their foreach loops?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Equation - code review
by kulls (Hermit) on Aug 16, 2006 at 04:29 UTC | |
Thanks in advance. - kulls | [reply] [d/l] |
by imp (Priest) on Aug 16, 2006 at 08:53 UTC | |
This line strikes me as possibly inefficient because it creates a new regex for each iteration, which means 1000 regex for a 1000 character sequence. So I wrote a benchmark to try a few strategies: Results for running 500 iterations with length 7:
Rate re_orig re_set bsubstr
re_orig 681/s -- -12% -92%
re_set 774/s 14% -- -91%
bsubstr 8475/s 1144% 995% --
Results for running 500 iterations with length 100:
Rate re_orig re_set bsubstr
re_orig 48.1/s -- -12% -93%
re_set 54.9/s 14% -- -92%
bsubstr 718/s 1392% 1209% --
Results for running 100 iterations with length 1000:
Rate re_set bsubstr
re_set 4.00/s -- -93%
bsubstr 59.5/s 1387% --
| [reply] [d/l] [select] |
by GrandFather (Saint) on Aug 16, 2006 at 11:13 UTC | |
DWIM is Perl's answer to Gödel | [reply] [d/l] |