Opened 9 years ago

Last modified 3 years ago

#540 assigned task

Explore ways to eliminate extra shared_pointers in hot path

Reported by: vorner Owned by: UnAssigned
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: 16.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by tomek)

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 (10)

comment:1 Changed 9 years ago by stephen

  • Estimated Difficulty changed from 0.0 to 16

comment:2 Changed 9 years ago by stephen

  • Milestone changed from A-Team-Sprint-20110223 to A-Team-Task-Backlog

comment:3 Changed 9 years ago by stephen

  • Milestone A-Team-Task-Backlog deleted

Milestone A-Team-Task-Backlog deleted

comment:4 Changed 8 years ago by shane

  • Defect Severity set to N/A
  • Owner set to vorner
  • Status changed from new to assigned
  • Sub-Project set to DNS

Similar to #539 and #530, should this idea for optimization be kept around?

comment:5 Changed 8 years ago by vorner

  • Milestone set to New Tasks
  • Owner changed from vorner to shane

These two you mention seem different to me.

However, #1601 seems very similar, thought it talks only about AuthSrv. This one also wants to look where everywhere they could be eliminated, I suspect there are more in datasource, the asiodns::Server class, etc.

comment:6 Changed 8 years ago by shane

  • Milestone New Tasks deleted
  • Owner changed from shane to UnAssigned

When I said "similar", I meant only in that it is an optimization ticket that is very old. :)

Anyway I'll leave this one open.

comment:7 Changed 5 years ago by tomek

  • Milestone set to Remaining BIND10 tickets

comment:8 Changed 5 years ago by tomek

  • Component changed from Unclassified to dhcp
  • Milestone changed from Remaining BIND10 tickets to DHCP Outstanding Tasks
  • Version set to git

It makes sense to do similar analysis for DHCP. Let's keep it open.

comment:9 Changed 4 years ago by tomek

  • Milestone changed from DHCP Outstanding Tasks to Outstanding Tasks

Milestone renamed

comment:10 Changed 3 years ago by tomek

  • Description modified (diff)
  • Keywords performance added
Note: See TracTickets for help on using tickets.