Subject: [Boost-bugs] [Boost C++ Libraries] #3765: unordered containers use malloc() for each insertion
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-12 19:11:16
#3765: unordered containers use malloc() for each insertion
--------------------------------------------------+-------------------------
Reporter: Paul Pogonyshev <pogonyshev@â¦> | Owner: danieljames
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: unordered
Version: Boost 1.41.0 | Severity: Optimization
Keywords: |
--------------------------------------------------+-------------------------
At least with STL that comes with G++ 4.4, Boost.Unordered containers use
malloc() on each insertion, which degrades performance.
For example, with the attached trivial program I set a breakpoint on
_int_malloc() in GDB and the second stacktrace looks this way:
#0 _int_malloc (av=0xb7e853c0, bytes=8) at malloc.c:4275
#1 0xb7db117e in *__GI___libc_malloc (bytes=8) at malloc.c:3660
#2 0xb7f86167 in operator new(unsigned int) () from
/usr/lib/libstdc++.so.6
#3 0x08049c3c in
__gnu_cxx::new_allocator<boost::unordered_detail::hash_table_data_unique_keys<std::allocator<int>
>::node>::allocate(unsigned int, void const*) ()
#4 0x080497ff in
boost::unordered_detail::hash_table_data_unique_keys<std::allocator<int>
>::node_constructor::construct_preamble() ()
...
malloc() and friends are quite prominent in profile of my actual program
as the result of the usage from boost::unordered_set.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3765> 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:02 UTC