Opened 9 years ago

Last modified 3 years ago

#540 assigned task

Explore ways to eliminate extra shared_pointers in hot path — at Initial Version

Reported by: vorner Owned by:
Priority: medium Milestone: Outstanding Tasks
Component: dhcp Version: git
Keywords: performance Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

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.

Subtickets

Change History (0)

Note: See TracTickets for help on using tickets.