boostorg / container

STL-like containers from Boost
http://www.boost.org/libs/container/
Boost Software License 1.0
96 stars 116 forks source link

flat_map slow insertion introduced in boost-1.80.0 #248

Open biljazovic opened 1 year ago

biljazovic commented 1 year ago

Hello,

I noticed that inserting elements in flat_map<int,int> is around 2 times slower going from version boost-1.79.0 to boost-1.80.0. I've found the relevant commit, 0d5068.

Sample code that is 2x faster when said commit is reverted:

#include <boost/container/flat_map.hpp>

int main() {
    boost::container::flat_map<int, int> m_flat_map;
    for (int i = 100000; i >= 0; --i) m_flat_map[i] = 1;
    return 0;
}

compiler: clang 15.0.7, linux-gnu platform

psiha commented 6 months ago

upvote