Oops, that's limited to insertions at the start or end.
Still wrong:
C:\test>perl -MTime::HiRes=time -E"$t=time; my @a; push @a, 1 for 1 .. 2**19; say (time()-$t)/2**19" 0.123739004135132 C:\test>perl -MTime::HiRes=time -E"$t=time; my @a; push @a, 1 for 1 .. 2**20; say (time()-$t)/2**20" 0.226538896560669 C:\test>perl -MTime::HiRes=time -E"$t=time; my @a; push @a, 1 for 1 .. 2**21; say (time()-$t)/2**21" 0.46043586730957
I avoided the theoretical BS, sticking to real world cases.
You get worse.
In reply to Re^4: Array or Hash
by BrowserUk
in thread Array or Hash
by palanisamy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |