Perl Monk, Perl Meditation | |
PerlMonks |
Re^5: Perl 5's greatest limitation is...?by themage (Friar) |
on Jul 31, 2005 at 22:05 UTC ( [id://479748]=note: print w/replies, xml ) | Need Help?? |
Hi,
I have a small question... Those benchmarks, You need to implement the same algorithm or you can change the algorithm as long as the results are the same? Sure, it is an idiotic question, diferent algorithms are not benchmarkable together. But, for example, with the ackermann benchmark, there is after some analisis an small change very, very, very much more eficient, than the presented, based in a special case of that algorithm: In Ack($m,$n), with $m<3, the result can be calculed using $m*$n+$m+1. In this case, the result would be the same, but, even if you still need to use the recursive algorithm to find the results for $m>=3, it would reduce to an infime part the number of interactions taken to find the result.
TheMage http://themage.bliker.com
In Section
Meditations
|
|