If I were you, I would benchmark my code on some corpus of data (preferably as likely to what I would use in production as possible). Check out:
Benchmark::Timer from CPAN, or do a search for benchmarking. Then, when you find the slow sections of your algorithm, either optimize them in Perl, or use a module like
Inline::CPP to speed up your code. (There are a bunch of inline modules in case you want to inline C, Assembler, Java, or whatever)
Want to support the EFF and FSF by buying cool stuff? Click
here.