[Boost-bugs] [Boost C++ Libraries] #9637: Boost.Container vector::resize() performance issue

Subject: [Boost-bugs] [Boost C++ Libraries] #9637: Boost.Container vector::resize() performance issue
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-06 20:52:04


#9637: Boost.Container vector::resize() performance issue
------------------------------------------+--------------------------
 Reporter: Dariush Forouher <dariush@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.55.0 | Severity: Optimization
 Keywords: |
------------------------------------------+--------------------------
 Hi,

 I noticed that resize() on a boost vector is quite slow compared to the
 equivalent operation on a std::vector:

 {{{
 int size=2000000;

 std::vector<char, std::allocator<char> > vec;
 vec.resize(size); // ~500 us

 boost::container::vector<char, std::allocator<char> > vec2;
 vec2.resize(size); // ~3000 us
 }}}

 I've attached a test program, compiled with "g++ -O3 -o test test.cpp"

 Environment:
 * gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04)
 * boost 1.55.0

 (Side note: the performance is even worse when compiled with -O0).

 cheers
 Dariush

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9637>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC