in reply to ForkManager Running Real Slow
Not surprising really. You are starting & reaping a million threads, each of which call a sub that returns a constant and then dies. The cost of starting and reaping each thread is about 1000 times the cost of calling that sub. The more concurrent thread you run, the more competition there is for system resources (mostly memory), so the longer it takes to start and reap each thread.
For want of a better anology, its like having a million navvies try to dig a trench, whilst sharing one shovel.
Perhaps a better anology: a million miners dig a one-man wide tunnel, one shovel load at a time. The more you send into the tunnel, the harder it is for each man to get to the digface and get his one shovel full.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ForkManager Running Real Slow
by SuicideJunkie (Vicar) on Sep 04, 2009 at 13:28 UTC | |
by BrowserUk (Patriarch) on Sep 04, 2009 at 14:02 UTC | |
by SuicideJunkie (Vicar) on Sep 04, 2009 at 14:34 UTC | |
by roboticus (Chancellor) on Sep 04, 2009 at 16:17 UTC |