summaryrefslogtreecommitdiff
path: root/innobase/buf
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-22 15:47:46 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-22 15:47:46 +0300
commitf51eb30b5a9f769ebe1af8cbd56fc6f3183d4bb3 (patch)
tree1752616269ea663882fa62451283e57b384d24e3 /innobase/buf
parent1c8f5500963814507754e878e092fdc76ebce6a7 (diff)
downloadmariadb-git-f51eb30b5a9f769ebe1af8cbd56fc6f3183d4bb3.tar.gz
rem0cmp.c:
Add UNIV_LIKELY and UNIV_UNLIKELY hints. cmp_dtuple_rec_with_match(): Move condition outside loop. Reduce the number of comparisons per iteration. mtr0mtr.c: mtr_memo_slot_release(): Add a UNIV_LIKELY hint. Simplify the preprocessor magic. buf0buf.c: buf_page_optimistic_get_func(): Add UNIV_UNLIKELY hints. Introduce an exit_func label to remove duplicated error exits. innobase/buf/buf0buf.c: buf_page_optimistic_get_func(): Add UNIV_UNLIKELY hints. Introduce an exit_func label to remove duplicated error exits. innobase/mtr/mtr0mtr.c: mtr_memo_slot_release(): Add a UNIV_LIKELY hint. Simplify the preprocessor magic. innobase/rem/rem0cmp.c: Add UNIV_LIKELY and UNIV_UNLIKELY hints. cmp_dtuple_rec_with_match(): Move condition outside loop. Reduce the number of comparisons per iteration.
Diffstat (limited to 'innobase/buf')
-rw-r--r--innobase/buf/buf0buf.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index 89f851709db..fca0b9f85f8 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -1286,8 +1286,9 @@ buf_page_optimistic_get_func(
/* If AWE is used, block may have a different frame now, e.g., NULL */
- if (block->state != BUF_BLOCK_FILE_PAGE || block->frame != guess) {
-
+ if (UNIV_UNLIKELY(block->state != BUF_BLOCK_FILE_PAGE)
+ || UNIV_UNLIKELY(block->frame != guess)) {
+ exit_func:
mutex_exit(&(buf_pool->mutex));
return(FALSE);
@@ -1320,19 +1321,17 @@ buf_page_optimistic_get_func(
fix_type = MTR_MEMO_PAGE_X_FIX;
}
- if (!success) {
+ if (UNIV_UNLIKELY(!success)) {
mutex_enter(&(buf_pool->mutex));
block->buf_fix_count--;
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
-#endif
- mutex_exit(&(buf_pool->mutex));
-
- return(FALSE);
+#endif
+ goto exit_func;
}
- if (!UT_DULINT_EQ(modify_clock, block->modify_clock)) {
+ if (UNIV_UNLIKELY(!UT_DULINT_EQ(modify_clock, block->modify_clock))) {
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(block->frame, SYNC_NO_ORDER_CHECK);
#endif /* UNIV_SYNC_DEBUG */
@@ -1347,10 +1346,8 @@ buf_page_optimistic_get_func(
block->buf_fix_count--;
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
-#endif
- mutex_exit(&(buf_pool->mutex));
-
- return(FALSE);
+#endif
+ goto exit_func;
}
mtr_memo_push(mtr, block, fix_type);
@@ -1368,7 +1365,7 @@ buf_page_optimistic_get_func(
#ifdef UNIV_DEBUG_FILE_ACCESSES
ut_a(block->file_page_was_freed == FALSE);
#endif
- if (!accessed) {
+ if (UNIV_UNLIKELY(!accessed)) {
/* In the case of a first access, try to apply linear
read-ahead */