Hello Patrick.

On Thu, May 5, 2011 at 6:15 AM, Patrick R. Michaud <[email protected]> wrote:
> On Wed, May 04, 2011 at 08:17:12AM -0500, Patrick R. Michaud wrote:
>> I'm currently re-running the suite on my desktop with 64-bit to make
>> its statistics and logs completely consistent with the new rakbench
>> scripts I'm using.
>
> ...and the re-run shows similar results as before -- Rakudo with Parrot 3.3
> is slower than Rakudo with Parrot 3.0:

Can you try parrot 3.3 with attached patch?

My main suspition that we have quite different memory layouts between
_compiled_ parrot.

-- 
Bacek
diff --git a/src/gc/gc_gms.c b/src/gc/gc_gms.c
index 84ac625..7d44c43 100644
--- a/src/gc/gc_gms.c
+++ b/src/gc/gc_gms.c
@@ -1520,10 +1520,11 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr))
     pmc_alloc_struct * const item = PMC2PAC(ptr);
     size_t            i;
 
-    if (!obj || !item)
+    /* Not aligned pointers aren't pointers */
+    if (!obj || !item || ((int)obj & 3) || ((int)item & 3))
         return 0;
 
-    if (!Parrot_gc_pool_is_owned(interp, self->pmc_allocator, item))
+    if (!Parrot_gc_pool_is_maybe_owned(interp, self->pmc_allocator, item))
         return 0;
 
     /* black or white objects marked already. */
@@ -1538,11 +1539,13 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr))
     if (PObj_GC_on_dirty_list_TEST(&item->pmc))
         return 0;
 
-    for (i = 0; i < MAX_GENERATIONS; i++) {
-        /* Pool.is_owned isn't precise enough (yet) */
-        if (Parrot_pa_is_owned(interp, self->objects[i], item, item->ptr))
-            return 1;
-    }
+    if (!Parrot_gc_pool_is_owned(interp, self->pmc_allocator, item))
+        return 0;
+
+    /* Pool.is_owned isn't precise enough (yet) */
+    /* We don't care about older generations on C stack. They will be marked anyway */
+    if (Parrot_pa_is_owned(interp, self->objects[0], item, item->ptr))
+        return 1;
 
     return 0;
 }
@@ -1667,10 +1670,11 @@ gc_gms_is_string_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr))
     string_alloc_struct * const item = STR2PAC(ptr);
     size_t            i;
 
-    if (!obj || !item)
+    /* Not aligned pointers aren't pointers */
+    if (!obj || !item || ((int)obj & 3) || ((int)item & 3))
         return 0;
 
-    if (!Parrot_gc_pool_is_owned(interp, self->string_allocator, item))
+    if (!Parrot_gc_pool_is_maybe_owned(interp, self->string_allocator, item))
         return 0;
 
     /* black or white objects marked already. */
@@ -1681,11 +1685,12 @@ gc_gms_is_string_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr))
     if (POBJ2GEN(&item->str) > self->gen_to_collect)
         return 0;
 
-    /* Pool.is_owned isn't precise enough (yet) */
-    for (i = 0; i < MAX_GENERATIONS; i++) {
-        if (Parrot_pa_is_owned(interp, self->strings[i], item, item->ptr))
-            return 1;
-    }
+    if (!Parrot_gc_pool_is_owned(interp, self->string_allocator, item))
+        return 0;
+
+    if (Parrot_pa_is_owned(interp, self->strings[0], item, item->ptr))
+        return 1;
+
     return 0;
 }
 
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to