sub test6 { my $n = $_[0] & $_[1]; my $count = 0; ++$count, $n &= $n - 1 while $n; $count; } #### sub countbits { my($n, $count) = ($_[0], 0); ++$count, $n &= $n - 1 while $n; return $count; } sub test7 { my($iDays, $iCmp) = @_; return countbits($iDays & $iCmp); } #### 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% --