Let's test that hypothesis:
use Time::HiRes qw(gettimeofday tv_interval); my @array = (1..100); # say "@array"; # 0.332776 s # say @array; # 0.052496 s # #<nothing> # 0.052361 s my $t0 = [gettimeofday]; for (1..10000) { my @array2 = @array; } say tv_interval($t0); __END__ SV = IV(0xe47dd8) at 0xe47de8 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 1 SV = PVIV(0xe512d8) at 0xe47de8 REFCNT = 1 FLAGS = (IOK,POK,pIOK,pPOK) IV = 1 PV = 0xe56050 "1"\0 CUR = 1 LEN = 16
So yes, interpolating the array into the string adds a PV (string) representation to the scalar.
In reply to Re^2: Strange performance loss after interpolating an array and then copying to another array;
by moritz
in thread Strange performance loss after interpolating an array and then copying to another array;
by Kc12349
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |