in reply to Re: 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;

That makes sense, though I am curious if perl bothers to copy both internal scalar representations. I ran my test again preceded by the below. I force each element into numeric context again after interpolating. I get almost all the performance back with this approach, but not quite all of it.

for my $element (@array) { $element += 0; }
  • Comment on Re^2: Strange performance loss after interpolating an array and then copying to another array;
  • Download Code