mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-22 17:30:44 -05:00
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
75 lines
700 B
Text
75 lines
700 B
Text
@@
|
|
statement S;
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- if (V != ISC_R_SUCCESS) S
|
|
|
|
@@
|
|
statement S1, S2;
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- if (V == ISC_R_SUCCESS)
|
|
S1
|
|
- else S2
|
|
|
|
@@
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- check_result(V, ...);
|
|
|
|
@@
|
|
@@
|
|
|
|
- CHECK(
|
|
dns_message_create(...)
|
|
- )
|
|
;
|
|
|
|
@@
|
|
@@
|
|
|
|
- DO(...,
|
|
dns_message_create(...)
|
|
- )
|
|
;
|
|
|
|
@@
|
|
@@
|
|
|
|
- RETERR(
|
|
dns_message_create(...)
|
|
- )
|
|
;
|
|
|
|
@@
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- assert_int_equal(V, ISC_R_SUCCESS);
|
|
|
|
@@
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- CHECK(..., V);
|
|
|
|
@@
|
|
expression V;
|
|
@@
|
|
|
|
- V =
|
|
dns_message_create(...);
|
|
- RUNTIME_CHECK(V == ISC_R_SUCCESS);
|