FAQ
Hi everybody,

Running some trivial performance test case (on Perl 5.8.8) I stumbled on
a minor bug in core module Benchmark.pm. My test case compare running
time of different ways to find all files matching a given pattern in a
given directory. Results were showing that the fastest method was
calling the shell find utility and use external grep, way faster than
using opendir/readdir and perl regexp. Sounds not logical. Indeed it
is'nt. The real explanation was that cmpthese does not count time
consumed by child process. If current style is'nt 'nop' (count only time
consumed in child process) it is supposed to be 'noc' (count only time
consumed in main process)... well, the default case should be 'all'.

To make it shorter, here is a small patch for Benchmark.pm that corrects
this behavior and the test program I used to test.

Regards,
--
christophe grosjean <christophe.grosjean@gmail.com>

Search Discussions

  • Rafael Garcia-Suarez at Dec 3, 2006 at 1:59 pm

    On 03/12/06, christophe grosjean wrote:
    Hi everybody,

    Running some trivial performance test case (on Perl 5.8.8) I stumbled on
    a minor bug in core module Benchmark.pm. My test case compare running
    time of different ways to find all files matching a given pattern in a
    given directory. Results were showing that the fastest method was
    calling the shell find utility and use external grep, way faster than
    using opendir/readdir and perl regexp. Sounds not logical. Indeed it
    is'nt. The real explanation was that cmpthese does not count time
    consumed by child process. If current style is'nt 'nop' (count only time
    consumed in child process) it is supposed to be 'noc' (count only time
    consumed in main process)... well, the default case should be 'all'.

    To make it shorter, here is a small patch for Benchmark.pm that corrects
    this behavior and the test program I used to test.
    Thanks, applied to bleadperl as change #29439. (I also bumped the
    version of Benchmark.pm.)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedDec 3, '06 at 12:33a
activeDec 3, '06 at 1:59p
posts2
users2
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase