develooper Front page | perl.perl5.porters | Postings from September 2003

Benchmark update in maint 5.8.1 needed?

From:
Elizabeth Mattijsen
Date:
September 8, 2003 11:17
Subject:
Benchmark update in maint 5.8.1 needed?
Message ID:
p05111b15bb827705f16e@[192.168.56.4]
The following code:

use Benchmark;

timethese( 1000, {
  open => sub {
      open my $handle, $^X.' -V:ccflags |';
      my $ccflags = <$handle>;
      delete $INC{'Config.pm'};
  },
  use => sub {
      require Config; Config->import;
      my $ccflags = $Config{ccflags};
      delete $INC{'Config.pm'};
  },
} );

produces (with maint-21021)

Benchmark: timing 1000 iterations of open, use...
  open: 38 wallclock secs ( 2.62 usr  0.00 sys + 16.14 cusr 12.96 csys 
= 31.72 CPU) @ 381.68/s (n=1000)
   use: 14 wallclock secs (13.15 usr +  0.00 sys = 13.15 CPU) @ 76.05/s (n=1000)


which would imply that you can many more open()s than loading Config.pm.

But alas, this is caused by the fact that the calculation for number 
of runs per second only takes "usr" CPU in account, rather than total 
CPU used.

According to merlyn, this seems to be fixed with bleed.  Maybe 
bleed's Benchmark.pm should be backported.  Or should I supply a 
patch for the current maint Benchmark.pm to fix this problem?


Liz



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About