in reply to Re: Thread::Queue memory issue with nested maps but not foreach loops...
in thread Thread::Queue memory issue with nested maps but not foreach loops...
Everything in your post makes sense to me; however, I have a single threaded version of the program that uses the same amount of memory using both the nested maps and the foreach loop. 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 threaded version and the single threaded version are basically identical except instead of loading a queue, I call &doWork on the string. If the Thread::Queue was not part of the problem, shouldn't nested map use more memory than the nested foreach loops? From my testing, the outrageous use of memory only occurs when I am using Threads and Thread::Queue, otherwise the two perform similarly.
Thankyou
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Thread::Queue memory issue with nested maps but not foreach loops...
by BrowserUk (Patriarch) on Mar 03, 2012 at 05:20 UTC | |
by ikegami (Patriarch) on Mar 03, 2012 at 08:40 UTC | |
by BrowserUk (Patriarch) on Mar 03, 2012 at 09:41 UTC |