in reply to Re^3: Why is const x const not a const?
in thread Why is const x const not a const?
And then there's 1..100_000 that creates an array and 100,000 scalars at compile-time.
Really? Can you demonstrate that?
Because I see no evidence for it:
c:\test>perl -le"++$n for 1..1e2; system qq[tasklist /nh /fi \"pid eq +$$\"] " perl.exe 7500 Console 1 5 +,716 K c:\test>perl -le"++$n for 1..1e3; system qq[tasklist /nh /fi \"pid eq +$$\"] " perl.exe 3676 Console 1 5 +,712 K c:\test>perl -le"++$n for 1..1e4; system qq[tasklist /nh /fi \"pid eq +$$\"] " perl.exe 6048 Console 1 5 +,732 K c:\test>perl -le"++$n for 1..1e5; system qq[tasklist /nh /fi \"pid eq +$$\"] " perl.exe 5648 Console 1 5 +,720 K c:\test>perl -le"++$n for 1..1e6; system qq[tasklist /nh /fi \"pid eq +$$\"] " perl.exe 8620 Console 1 5 +,736 K
Whilst the memory usage varies a little, it sometime goes down a few k when the notional size of this array increases by an order of magnitude?
Conversely, if you explicitly create an array of that size, the memory requirement increases by 100MB as expected:
c:\test>perl -le"@a = 1 .. 1e6; system qq[tasklist /nh /fi \"pid eq $$ +\"] " perl.exe 2664 Console 1 109 +,576 K
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Why is const x const not a const?
by LanX (Saint) on Jan 24, 2012 at 14:05 UTC |