Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: RFC: Is the Bible encoded in DNA?

by wstryder (Novice)
on May 14, 2018 at 19:01 UTC ( [id://1214491]=note: print w/replies, xml ) Need Help??


in reply to Re^2: RFC: Is the Bible encoded in DNA?
in thread RFC: Is the Bible encoded in DNA?

Nobody has spotted the obvious, that the code for reading the file is painfully slow.

A significant improvement would be:

while (read($fh, my $char, 1) && $eof) { if ($char =~ m/[ACGT]/ ) { $i++; if ($i >= $start_genome && $i < $end_genome) { push (@genome, $char); } elsif ($i > $end_genome) { $eof = 0; # do the searching here, instead of outside the loop! } } }

Replies are listed 'Best First'.
Re^4: RFC: Is the Bible encoded in DNA?
by wstryder (Novice) on May 14, 2018 at 20:56 UTC
    That's now fixed and the algorithm doesn't go back to the beginning of the file every time a chunk is read. Silly me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found