Boost logo

Boost Users :

Subject: [Boost-users] [ Interprocess ] Object allocation performance
From: Yordan Pavlov (y.d.pavlov_at_[hidden])
Date: 2011-10-03 12:35:03


It looks like this:

MyType * pMy = my_segment->construct<MyType>(anonymous_instance)();
my_segment->destroy_ptr(pMy);

Where *MyType* is some typical struct and *my_segment* is correctly
constructed *boost::interprocess::managed_shared_memory ** is around 10
times slower than the equivalent:

MyType * pMy = new MyType();
delete pMy;

I did not expect this. I though the two allocation algorithms should be
similar in implementation and performance. Is there some good reason for
such a huge difference.

Edit: The test was conducted over a huge number of iterations.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net