in reply to Re^2: Thread::Queue memory issue with nested maps but not foreach loops...
in thread Thread::Queue memory issue with nested maps but not foreach loops...
Also, aren't newer versions of perl optimized such that when map is used in a void context, the extra work that differentiates it from foreach and from for optimized away? (Source: http://www.perlmonks.org/index.pl?node_id=296742)
The optimisation relating to map in a void context is that map doesn't build the return list (what would be returned from the map) when it detects it is called in a void context. It doesn't (I think "can't", but I not sure of that), stop the input list being built.
From my testing, the outrageous use of memory only occurs when I am using Threads and Thread::Queue, otherwise the two perform similarly.
Post -- or send me via the mail ID on my home page -- the real code. Then we'll see.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Thread::Queue memory issue with nested maps but not foreach loops...
by ikegami (Patriarch) on Mar 03, 2012 at 08:40 UTC | |
by BrowserUk (Patriarch) on Mar 03, 2012 at 09:41 UTC |