> Instead of guessing branch probabilities, why not measure them?
Or, simply tell the compiler what you expect. Sometimes, GCC
predicts incorrectly - if-branches are usually assumed _not_
to be executed.
if (expect_true(x)) {
foo();
}
with..
#ifdef HAVE_BUILTIN_EXPECT
# define expect_true(x) __builtin_expect((x), 1)
# define expect_false(x) __builtin_expect((x), 0)
#else
# define expect_true(x) (x)
# define expect_false(x) (x)
#endif
- Sascha
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php