clearly the massive differences between tin2 and tin3 must at least alert you that something is wrong with the benchmark...
The problem is that his $b kept growing. You fixed it by readding my $b = 0;.
Which leads to two the second problem: He didn't use warnings. They don't add a penalty, so use them! If they did add a penalty, all the more reason to use them just like in the real code.
By the way,
$output[int($_/3)]
can be written as
$output[$_/3]
In reply to Re^4: Summing Up Array Elements By Group
by ikegami
in thread Summing Up Array Elements By Group
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |