fast_pool_allocator question
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 ). -- View this message in context: http://boost.2283326.n4.nabble.com/fast-pool-allocator-question-tp3596247p35... Sent from the Boost - Users mailing list archive at Nabble.com.
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
I think the pool / thread is good idea. I tried out the tcmalloc library and seems to be working well so far. I think that uses different pool for each thread. I could try out a boost type of implementation if one exists. -- View this message in context: http://boost.2283326.n4.nabble.com/fast-pool-allocator-question-tp3596247p35... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Brad Howes
-
steviekm3