List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:November 25 2010 12:53pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4018)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4018 Jonas Oreland	2010-11-25
      ndb - mt.cpp micro optimization (observed using oprofile on various load)

    modified:
      storage/ndb/src/kernel/vm/GlobalData.hpp
      storage/ndb/src/kernel/vm/mt.cpp
=== modified file 'storage/ndb/src/kernel/vm/GlobalData.hpp'
--- a/storage/ndb/src/kernel/vm/GlobalData.hpp	2010-04-28 12:21:54 +0000
+++ b/storage/ndb/src/kernel/vm/GlobalData.hpp	2010-11-25 12:53:32 +0000
@@ -96,6 +96,7 @@ struct GlobalData {
   SimulatedBlock * getBlockInstance(BlockNumber fullBlockNo) {
     return getBlock(blockToMain(fullBlockNo), blockToInstance(fullBlockNo));
   }
+  SimulatedBlock * mt_getBlock(BlockNumber blockNo, Uint32 instanceNo);
   
   void           incrementWatchDogCounter(Uint32 place);
   Uint32 * getWatchDogPtr();

=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp	2010-11-09 10:45:29 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp	2010-11-25 12:53:32 +0000
@@ -34,6 +34,16 @@
 
 #include "mt-asm.h"
 
+inline
+SimulatedBlock*
+GlobalData::mt_getBlock(BlockNumber blockNo, Uint32 instanceNo)
+{
+  SimulatedBlock* b = getBlock(blockNo);
+  if (b != 0 && instanceNo != 0)
+    b = b->getInstance(instanceNo);
+  return b;
+}
+
 #ifdef __GNUC__
 /* Provides a small (but noticeable) speedup in benchmarks. */
 #define memcpy __builtin_memcpy
@@ -2395,7 +2405,7 @@ execute_signals(thr_data *selfptr, thr_j
     }
     Uint32 bno = blockToMain(s->theReceiversBlockNumber);
     Uint32 ino = map_instance(s);
-    SimulatedBlock* block = globalData.getBlock(bno, ino);
+    SimulatedBlock* block = globalData.mt_getBlock(bno, ino);
     assert(block != 0);
 
     Uint32 gsn = s->theVerId_signalNumber;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101125125332-9u0qb22xyqec7kna.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4018) Jonas Oreland25 Nov