Tracks the progress of making old Perl scripts faster and more maintainable. Working from Meneghin's perl-for-reysenbach-lab repository of bioinformatics scripts.
This is a refactoring, so the output of the script should not change.
Make the scripts easier to maintain and follow
Best Practices
where possible. E.g. use my
to localize variables.
Make them faster by cutting down unnecessary loops and computation.
Take advantage of newer features of Modern Perl
(e.g. say
instead of print "\n"
)
Try to make the code shorter while maintaining readability.
-
Translate the code into my personal style, adding basic Best Practice and changing the code as little as possible. This helps me understand what the code is doing.
-
Verify the output is the same
-
Use NYTProf to identify the longest running subs/statements (highlighted in red), copy script into new file and optimize one thing
-
Benchmark with hyperfine
-
Verify the output and repeat from 3. until all reasonable optimizations made