in reply to when to use lists/hash vs references?
Not the only, and maybe not the most important, but here's one reason. The extra dereference costs:
c:\test>p1 @a = map[1..3],1..1e6;; $r = \@a;; cmpthese -1, { a=>q[ ++$a[$_][1] for 0..$#a ], b=>q[ ++$r->[$_][1] for 0..$#$r ] };; Rate b a b 3.94/s -- -16% a 4.72/s 20% --
Another is that the extra syntax can get unwieldy for involved expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: when to use lists/hash vs references?
by chromatic (Archbishop) on Jul 16, 2010 at 00:30 UTC | |
by BrowserUk (Patriarch) on Jul 16, 2010 at 00:49 UTC | |
by chromatic (Archbishop) on Jul 16, 2010 at 01:20 UTC | |
by BrowserUk (Patriarch) on Jul 16, 2010 at 01:49 UTC | |
by chromatic (Archbishop) on Jul 16, 2010 at 02:33 UTC | |
|