mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Stop providing branch prediction information
The __builtin_expect() can be used to provide the compiler with branch prediction information. The Gcc manual says[1] on the subject: In general, you should prefer to use actual profile feedback for this (-fprofile-arcs), as programmers are notoriously bad at predicting how their programs actually perform. Stop using __builtin_expect() and ISC_LIKELY() and ISC_UNLIKELY() macros to provide the branch prediction information as the performance testing shows that named performs better when the __builtin_expect() is not being used. 1. https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect
This commit is contained in:
@@ -835,7 +835,7 @@ dns_message_findtype(const dns_name_t *name, dns_rdatatype_t type,
|
||||
curr = ISC_LIST_PREV(curr, link))
|
||||
{
|
||||
if (curr->type == type && curr->covers == covers) {
|
||||
if (ISC_UNLIKELY(rdataset != NULL)) {
|
||||
if (rdataset != NULL) {
|
||||
*rdataset = curr;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
@@ -2450,7 +2450,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
|
||||
/*
|
||||
* And now look for the type.
|
||||
*/
|
||||
if (ISC_UNLIKELY(type == dns_rdatatype_any)) {
|
||||
if (type == dns_rdatatype_any) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user