in reply to threads::shared seems to kill performance
Hmm, well, I'd sort of expect 5,000,000 &share calls to take a reasonable amount of time, yes. Hashes - particularly multidimensional ones - don't work well with thread::shared. What you've got is essentially a fudge that creates a lot of separate anonymous hashes, and links them together.
However if - as you say - your data is read only from your threads, you might not need to do that - if you initialise prior to instantiating your threads, they'll take a copy of your global namespace anyway. You just won't be able to modify it within the thread (or technically - you can, but it won't replicate to other threads).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: threads::shared seems to kill performance
by Jacobs (Novice) on Jul 18, 2013 at 04:51 UTC | |
by Preceptor (Deacon) on Jul 18, 2013 at 08:16 UTC |