M
Matthias Weckman
Hi all,
I hope you may be able to shed some light on this.
I'm using ActiveState Perl 5.8.0 (build 806) on Windows 2000, and
noticed that slurping a file was very slow compared to the old 5.6.1.
I narrowed it down to the . operator taking a lot of time, see the
script below.
I tried searching the web for some info on this, but couldn't find
anything on Google, bugs.perl.org or activestate.com.
Is this an issue with ActiveState's build only? Or is it a 5.8.0 issue
in general? Do you know if it has been fixed in 5.8.1?
Is there a way to improve this?
Unfortunately I do not have access to other versions of perl on other
platforms, so I can't compare.
Thanks,
Matthias
---8<---
use strict;
use warnings;
use Benchmark qw(timeit timestr);
my $c = 10;
my $t = timeit ($c, q!
my $x = '';
my $y = 'x' x 10000;
my $z = 0;
while($z < 7000000)
{
$z+=10000;
$x .= $y;
}
!
);
print "$c loops of concat took:",timestr($t),"\n";
__END__
Results for ActiveState Perl 5.8.0 build 806 On Win2K SP4:
10 loops of concat took:34 wallclock secs (19.13 usr + 13.54 sys = 32.67
CPU) @ 0.31/s (n=10)
Results for ActiveState Perl 5.6.1 build 635 On Win2K SP4:
10 loops of concat took: 1 wallclock secs ( 0.39 usr + 0.03 sys = 0.42
CPU) @ 23.81/s (n=10)
I hope you may be able to shed some light on this.
I'm using ActiveState Perl 5.8.0 (build 806) on Windows 2000, and
noticed that slurping a file was very slow compared to the old 5.6.1.
I narrowed it down to the . operator taking a lot of time, see the
script below.
I tried searching the web for some info on this, but couldn't find
anything on Google, bugs.perl.org or activestate.com.
Is this an issue with ActiveState's build only? Or is it a 5.8.0 issue
in general? Do you know if it has been fixed in 5.8.1?
Is there a way to improve this?
Unfortunately I do not have access to other versions of perl on other
platforms, so I can't compare.
Thanks,
Matthias
---8<---
use strict;
use warnings;
use Benchmark qw(timeit timestr);
my $c = 10;
my $t = timeit ($c, q!
my $x = '';
my $y = 'x' x 10000;
my $z = 0;
while($z < 7000000)
{
$z+=10000;
$x .= $y;
}
!
);
print "$c loops of concat took:",timestr($t),"\n";
__END__
Results for ActiveState Perl 5.8.0 build 806 On Win2K SP4:
10 loops of concat took:34 wallclock secs (19.13 usr + 13.54 sys = 32.67
CPU) @ 0.31/s (n=10)
Results for ActiveState Perl 5.6.1 build 635 On Win2K SP4:
10 loops of concat took: 1 wallclock secs ( 0.39 usr + 0.03 sys = 0.42
CPU) @ 23.81/s (n=10)