in reply to Speeding up stalled script
While we’re on this subject, here’s something I’d really like to know: how memory-hungry is a line like this . . .
foreach my $key (keys %dstrbtn_hash) {
... versus, say, an iterator, e.g. each() applied to the same hash?
Is Perl going to build an in-memory anonymous array of all those keys, in order to subsequently foreach through it?
I’ve no doubt that the root cause of this problem is virtual-memory thrashing. But, is a statement like this one a “hidden” source of more memory consumption?
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Speeding up stalled script
by Athanasius (Archbishop) on Feb 05, 2015 at 08:02 UTC | |
by choroba (Cardinal) on Feb 05, 2015 at 12:30 UTC | |
by Athanasius (Archbishop) on Feb 05, 2015 at 13:53 UTC | |
by BrowserUk (Patriarch) on Feb 05, 2015 at 14:30 UTC | |
by Athanasius (Archbishop) on Feb 05, 2015 at 14:38 UTC |