Custom allocation using boost singleton_pool slower than default
问题 I wrote custom operator new and operator delete for the class MyOrder. I am allocating memory using boost::singleton pool. Here is the program testing the performance, #include <boost/pool/singleton_pool.hpp> #include <boost/progress.hpp> #include <iostream> #include <new> #include <vector> class MyOrder{ std::vector<int> v1_; std::vector<double> v2_; std::string s1_; std::string s2_; public: MyOrder(std::string s1, std::string s2): s1_(s1), s2_(s2) {} ~MyOrder(){} static void * operator new