in reply to Re^5: Should multiplication by integer be avoided in favour of division for performance reasons? (benchmark pitfalls)
in thread Should multiplication by integer be avoided in favour of division for performance reasons?
Since the same multiply op is used for all iterations, once it gets "poisoned" by trying to return an IV value for the last element of the first iteration, further calls to that op will start returning PVNVs. So for iterations 2+, all elements of @c will be PVNVs and thus slower to free.eval q[ for my $i (1..$n) { my @c = map $_ * 4, @a; } ]
It's also the case that multiply is fractionally slower at returning a PVNV value rather than an NV value.
Dave.
|
|---|