mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +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:
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "entropy_private.h"
|
||||
#include "isc/hash.h" /* IWYU pragma: keep */
|
||||
#include "isc/likely.h"
|
||||
#include "isc/once.h"
|
||||
#include "isc/random.h"
|
||||
#include "isc/result.h"
|
||||
@@ -74,7 +73,7 @@ static uint8_t maptolower[] = {
|
||||
|
||||
const void *
|
||||
isc_hash_get_initializer(void) {
|
||||
if (ISC_UNLIKELY(!hash_initialized)) {
|
||||
if (!hash_initialized) {
|
||||
RUNTIME_CHECK(
|
||||
isc_once_do(&isc_hash_once, isc_hash_initialize) ==
|
||||
ISC_R_SUCCESS);
|
||||
@@ -91,7 +90,7 @@ isc_hash_set_initializer(const void *initializer) {
|
||||
* Ensure that isc_hash_initialize() is not called after
|
||||
* isc_hash_set_initializer() is called.
|
||||
*/
|
||||
if (ISC_UNLIKELY(!hash_initialized)) {
|
||||
if (!hash_initialized) {
|
||||
RUNTIME_CHECK(
|
||||
isc_once_do(&isc_hash_once, isc_hash_initialize) ==
|
||||
ISC_R_SUCCESS);
|
||||
|
Reference in New Issue
Block a user