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

Benchmark update in maint 5.8.1 needed?

Elizabeth Mattijsen
September 8, 2003 11:17
Benchmark update in maint 5.8.1 needed?
Message ID:
The following code:

use Benchmark;

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

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

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 should be backported.  Or should I supply a 
patch for the current maint to fix this problem?

Liz Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About