Opened 4 years ago

Closed 4 years ago

#4499 closed defect (fixed)

performance improvement: inefficiency in CfgHosts::getAllInternal

Reported by: marcin Owned by: marcin
Priority: medium Milestone: Kea1.1
Component: dhcp Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 1 Internal?: no

Description

As a result of profiling tests on Kea server I found that the following code uses many CPU cycles:

// Use Host object to find the textual form of the identifier.
// This may throw exception if the identifier is invalid.
Host host(identifier, identifier_len, identifier_type,
                 SubnetID(0), SubnetID(0), IOAddress::IPV4_ZERO_ADDRESS());
identifier_text = host.getIdentifierAsText();

The construction of the Host object is CPU intensive and in fact the Host object exposes the static variant of getIdentifierAsText function which should be used instead.

Subtickets

Change History (5)

comment:1 Changed 4 years ago by hschempf

  • Milestone changed from Kea-proposed to Kea1.1

Per team meeting 12 May, accept 1.1. Estimate = .25d

comment:2 Changed 4 years ago by marcin

  • Owner set to marcin
  • Status changed from new to accepted

comment:3 Changed 4 years ago by marcin

  • Owner changed from marcin to UnAssigned
  • Status changed from accepted to reviewing

I have applied the necessary changes. Proposed ChangeLog entry:

11XX.	[bug]		marcin
	Performance improvement in hosts reservation: removed
	inefficient conversion of the host identifier to text
	when logging.
	(Trac #4499, git abcd)

comment:4 Changed 4 years ago by fdupont

  • Owner changed from UnAssigned to marcin
  • Total Hours changed from 0 to 1

Code seems OK. I don't expect the change to be user visible (so ChangeLog mandatory) but I can be wrong so I approve the ChangeLog proposal too.

comment:5 Changed 4 years ago by marcin

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged with commit 48c20790480d5ed7bfde0ef7b052dd4a9745607d

Note: See TracTickets for help on using tickets.