Re: [Boost-bugs] [Boost C++ Libraries] #3789: boost::object_pool::free() is very slow.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3789: boost::object_pool::free() is very slow.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-05 08:55:12


#3789: boost::object_pool::free() is very slow.
----------------------------------------+-----------------------------------
  Reporter: Dai Yun <dy95020@…> | Owner: edupuis
      Type: Bugs | Status: assigned
 Milestone: Boost 1.42.0 | Component: pool
   Version: Boost 1.41.0 | Severity: Problem
Resolution: | Keywords: object_pool
----------------------------------------+-----------------------------------

Comment (by johnmaddock):

 I'm not sure that what you're looking for is actually possible?

 The problem here is that object_pool always calls the
 ordered_(allocate|free) functions which are slow to free when there are a
 lot of free objects in the underlying pool.

 IMO it would have been better to have had object_pool have two
 allocate/free functions (ordered and unordered) like pool does, I thought
 about making that change, but it's a breaking change so I resisted it.
 Better still I can't help but thinking that the whole design is wrong
 (having ordered and unordered free methods in the same class that is).
 Then if you get into O(N) ordered free you're basically reimplementing the
 system allocator which is the whole thing that pool was trying to avoid.
 Maybe this limitation should just have better documentation - that pool is
 designed for fast allocate/free of small numbers of objects - and is not
 a complete heap replacement?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3789#comment:8>
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:09 UTC