in reply to Re^2: Strange performance loss after interpolating an array and then copying to another array;
in thread Strange performance loss after interpolating an array and then copying to another array;
So what causes the performance gain, though small, going from this:
use Time::HiRes qw(gettimeofday tv_interval); my @array = (1..100); for my $element (@array) { $element .= ''; } for my $element (@array) { $element += 0; } my $t0 = [gettimeofday]; for (1..10000) { my @array2 = @array; } say tv_interval($t0);
To this:
use Time::HiRes qw(gettimeofday tv_interval); my @array = (1..100); my $t0 = [gettimeofday]; for (1..10000) { my @array2 = @array; } say tv_interval($t0);
|
|---|