D:\perl> perl -MBenchmark -e "timethese( 1000000, { doubles => sub { my $interpolated = \"pomperipossa\" }, singles => sub {my $uninterpolated = 'pomperipossa' } } )"
Gives these results:
Benchmark: timing 1000000 iterations of doubles, singles...
doubles: 0 wallclock secs ( 0.46 usr + 0.00 sys = 0.46 CPU) @ 2169197.40/s (n=1000000)
singles: 0 wallclock secs ( 0.45 usr + 0.00 sys = 0.45 CPU) @ 2217294.90/s (n=1000000)
So in this (highly unrealistic) case, singles seem infinitesimally faster. I use singles for things I think will be constant, and doubles only when I actually want interpolation. But this is nothing to do with alleged speed benefits, and everything to do with making my intentions clear.
In reply to Re^3: Differences between " " and ' '?
by polypompholyx
in thread Differences between " " and ' '?
by Ace128
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |