- or download this
sub test6 {
my $n = $_[0] & $_[1];
...
++$count, $n &= $n - 1 while $n;
$count;
}
- or download this
sub countbits {
my($n, $count) = ($_[0], 0);
...
my($iDays, $iCmp) = @_;
return countbits($iDays & $iCmp);
}
- or download this
Rate Test4 Test5 Test7 Test6
Test4 106192/s -- -38% -40% -57%
Test5 172463/s 62% -- -3% -31%
Test7 176987/s 67% 3% -- -29%
Test6 248686/s 134% 44% 41% --