in reply to performance tool
You appear to be looking for a profiling tool. Check out Devel::DProf and Devel::SmallProf available on CPAN. Benchmark (as pointed out by grep above) can also be used to compare the relative efficiencies of algorithms.