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);
In reply to Re^3: Strange performance loss after interpolating an array and then copying to another array;
by Kc12349
in thread Strange performance loss after interpolating an array and then copying to another array;
by Kc12349
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |