add profiling....
authorbdemsky <bdemsky>
Sun, 10 Jul 2011 11:34:24 +0000 (11:34 +0000)
committerbdemsky <bdemsky>
Sun, 10 Jul 2011 11:34:24 +0000 (11:34 +0000)
hack memmove loop to speed it up...

Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregcflush.c

index 05bb2d8cba1054074ee31d0d0341622a284a071e..2853466c582487afb9e546ee207885fcd587cb62 100644 (file)
@@ -9,6 +9,9 @@
 #include "gcqueue.h"
 #include "multicoremem_helper.h"
 #include "bambooalign.h"
+#ifdef PERFCOUNT
+#include "bme_perf_counter.h"
+#endif
 
 volatile bool gcflag;
 gc_status_t gc_status_info;
@@ -529,6 +532,9 @@ bool gc(struct garbagelist * stackptr) {
     gc_status_info.gcprocessing = false;
     return false;
   }
+#ifdef PERFCOUNT
+  profile_start(GC_REGION);
+#endif
 
   // core coordinator routine
   if(0 == BAMBOO_NUM_OF_CORE) {
@@ -553,6 +559,9 @@ bool gc(struct garbagelist * stackptr) {
     gc_nocollect(stackptr);
   }
   postgcprocessing();
+#ifdef PERFCOUNT
+  profile_start(APP_REGION);
+#endif
   return true;
 } 
 
index 66b863c383dc3155ab461439f447bd9f7170ef54..198b03f8e8f139abf1ba93538ae50085ce85ba2f 100644 (file)
@@ -244,7 +244,63 @@ void * updateblocks(struct moveHelper * orig, struct moveHelper * to) {
 
       /* Move the object */
       if(origptr < endtoptr&&dstptr < origptr+length) {
-        memmove(dstptr, origptr, length);
+       unsigned int *sptr=origptr;
+       unsigned int *dptr=dstptr;
+       unsigned int len=length;
+       //we will never have an object of size 0....
+
+       do {
+         //#1
+         unsigned int tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#2
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#3
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#4
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#5
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#6
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#7
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         //#8
+         tmpptr0=*sptr;
+         sptr++;
+         *dptr=tmpptr0;
+         dptr++;
+
+         len=len-32;
+       } while(len);
+        //memmove(dstptr, origptr, length);
       } else if (origptr!=dstptr) {
        //no need to copy if the source & dest are equal....
         memcpy(dstptr, origptr, length);