On Jun 14, 2011, at 1:17 PM, steviekm3 wrote:
I was wondering if fast_pool_allocator will speed something up.
I have a funtion say g which looks like:
void g( Params p ) { std::map<double,Foo> m; for( int i = 0; i < 100000; ++it ) { m.insert( ... ) } }
g gets called from about 100 different threads running on 16 processor machine. All the processors are not being used near full capacity. I did some analysis and find that most of the time one thread is in malloc system call and other threads are blocking on it. ( I guess malloc only allows serial access a certain points ).
Would a fast_pool_allocator speed this up. Could I pre-allocate the memory needed using a fast_pool_allocator ? I don't want the pool to return memory to the system. Just to reuse memory that is no longer needed ( reuse memory that m has used after m goes out of scope ).
I had great success using pool allocators. But you would definitely win if you could have a pool / thread rather than a shared pool. Brad -- Brad Howes Calling Team - Skype Prague Skype: br.howes