Your benchmark code is wrong. You call each of your coderefs instead of passing them. You meant instead something like this:
cmpthese( 500_000, { statreuse => $coderef, nostatreuse => $coderef1, });
With working benchmark code I see the _ version running 78% faster than the separate calls.
Update: Meh, typo'd the percentage faster. Actual results running 500,000 tests with test.lnk being a plain file:
Rate nostatreuse statreuse
nostatreuse 65189/s -- -44%
statreuse 116279/s 78% --
Results from stock OS X perl v5.8.6 on a dual 2.7 G5.
In reply to Re: Use of undescore to reuse file stat data is slower
by Fletch
in thread Use of undescore to reuse file stat data is slower
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |