in reply to Use of undescore to reuse file stat data is slower

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.

Replies are listed 'Best First'.
Re^2: Use of undescore to reuse file stat data is slower
by Anonymous Monk on Jul 11, 2006 at 03:34 UTC
    Thanks. It was error in my benchmark code, and also as
    others pointed the print was unnecessary. The _ version
    runs faster.

    thanks,
    sateesh