5-10[pct] CPU increase #710

Closed
Habbie opened this Issue Apr 26, 2013 · 4 comments

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

Recursor 3.5-rc1/2 use 5-10% more CPU than 3.4-pre did. This has been tracked down to r3064. Need to investigate whether we can bring CPU usage back down.

@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie Habbie added a commit that referenced this issue Apr 26, 2013
@Habbie Habbie unpair name/proto for NS speed management. Fixes #710
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3132 d19b8d6e-7fed-0310-83ef-9ca221ded41b
5ea6f7d
@Habbie
Member
Habbie commented Apr 26, 2013

Attachment '' (20130305_string_comparison.patch) https://gist.github.com/5466872

@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
struct CIStringPairCompare makes no sense. I fail to see how it's possible that a.first would be equal to b.first but b.first would not be equal to a.first. Now you are wasting valuable cycles by comparing the strings twice even though the second if clause can only ever be false. It cannot be reached if it would be true.

Also, you could optimize pdns_ilexicographical_compare by checking whether the strings are different length before doing the expensive byte by byte comparison.

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
CIStringPairCompare reports bigger/smaller, just not equal/not equal. The simplification, therefore, will not work.

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
r3132 removes the v4/v6 distinction for the ns speed management, thus avoiding this slowdown.

@mind04 mind04 pushed a commit to mind04/pdns that referenced this issue Apr 26, 2013
peter unpair name/proto for NS speed management. Fixes #710
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3132 d19b8d6e-7fed-0310-83ef-9ca221ded41b
dbfca4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment