From 6920a6d5466b0241286051bb327d32bf2fdfa4dc Mon Sep 17 00:00:00 2001 From: "marko@hundin.mysql.fi" <> Date: Wed, 9 Mar 2005 22:04:55 +0200 Subject: InnoDB: Improve performance by about 10% by removing implicit memcpy() calls, by not initializing the offsets_[] arrays. InnoDB: Remove a Microsoft compiler warning in page0page.c. --- innobase/lock/lock0lock.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'innobase/lock') diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index a2560c1faae..66a746111e8 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -4094,8 +4094,9 @@ lock_rec_print( ulint i; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -4592,8 +4593,9 @@ lock_rec_validate_page( ulint i; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; #ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); @@ -4841,9 +4843,11 @@ lock_rec_insert_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; - const ulint* offsets = rec_get_offsets( - next_rec, index, offsets_, + ulint offsets_[100]; + const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + + offsets = rec_get_offsets(next_rec, index, offsets_, ULINT_UNDEFINED, &heap); ut_ad(lock_rec_queue_validate(next_rec, index, offsets)); if (heap) { @@ -4988,9 +4992,12 @@ lock_sec_rec_modify_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; - const ulint* offsets = rec_get_offsets( - rec, index, offsets_, ULINT_UNDEFINED, &heap); + ulint offsets_[100]; + const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + + offsets = rec_get_offsets(rec, index, offsets_, + ULINT_UNDEFINED, &heap); ut_ad(lock_rec_queue_validate(rec, index, offsets)); if (heap) { mem_heap_free(heap); @@ -5159,9 +5166,10 @@ lock_clust_rec_read_check_and_lock_alt( que_thr_t* thr) /* in: query thread */ { mem_heap_t* tmp_heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; ulint ret; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &tmp_heap); -- cgit v1.2.1