BIND 10 #540: Explore ways to eliminate extra shared_pointers in hot path

BIND 10 Development do-not-reply at isc.org
Wed Jan 26 21:24:41 UTC 2011


#540: Explore ways to eliminate extra shared_pointers in hot path
-------------------------------------+-------------------------------------
           Reporter:  vorner         |                      Owner:
               Type:  task           |                     Status:  new
           Priority:  major          |                  Milestone:  A-Team-
          Component:  Unclassified   |  Sprint-20110209
          Sensitive:  0              |                   Keywords:
Add Hours to Ticket:  0              |  Estimated Number of Hours:  0
        Total Hours:  0              |                  Billable?:  1
                                     |                  Internal?:  0
-------------------------------------+-------------------------------------
 We spend 8% of runtime in boost::detail::shared_count::~shared_count(),
 which is related to shared pointers. Therefore it would be good to find
 the ones on the hot path (the one where normal processing happens and have
 the biggest impact on performance) which are not needed and eliminate them
 (or create additional tasks for each of them).

 Possible situations include:
  * It is completely unnecessary.
  * std::auto_ptr would be enough.
  * Candidate for using a memory pool idea. We have a block of memory. Each
 time we need a temporary variable, we just take it from the block. Once we
 finished a query, we „drop“ the whole block (reset the position where we
 take the memory from to the beginning). It is faster because:
    - We don't need to call destructors at all.
    - We don't need to care when we should run the destructors (counting
 references, etc).
    - The memory we use a lot is located close together, which is better
 for CPU caches and TLBs.

-- 
Ticket URL: <https://bind10.isc.org/ticket/540>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list