On Sunday 05 September 2010 at 13:32, Patrick R wrote:

> Notes:
> 1.  It only takes about a second for y.pir to complete the 
>     C<load_bytecode 'perl6.pbc'> step -- the increase in 
>     execution time is almost entirely in the .'readall' method.
> 2.  There's no "large Rakudo parse tree or ast" lying around 
>     that would be artificially increasing the work of the GC -- 
>     this is truly compiled code.
> 3.  The code in y.pir is running entirely in the 'parrot' HLL
>     namespace, there are no Rakudo-specific PMCs, subroutines,
>     dispatchers, etc. being used once the load_bytecode has
>     completed.

How does the example fare for you with this patch?

diff --git a/src/gc/alloc_resources.c b/src/gc/alloc_resources.c
index 1136102..b76064c 100644
--- a/src/gc/alloc_resources.c
+++ b/src/gc/alloc_resources.c
@@ -304,31 +304,10 @@ mem_allocate(PARROT_INTERP,
 
     /* If not enough room, try to find some */
     if (pool->top_block->free < size) {
-        /*
-         * force a GC mark run to get live flags set
-         * for incremental M&S collection is run from there
-         * but only if there may be something worth collecting!
-         * TODO pass required allocation size to the GC system,
-         *      so that collection can be skipped if needed
-         */
-        size_t new_mem = mem_pools->memory_used -
-                         mem_pools->mem_used_last_collect;
-        if (!mem_pools->gc_mark_block_level
-            && new_mem > (mem_pools->mem_used_last_collect >> 2)
-            && new_mem > GC_SIZE_THRESHOLD) {
-            Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
-
-            if (interp->gc_sys->sys_type != INF) {
-                /* Compact the pool if allowed and worthwhile */
-                if (pool->compact) {
-                    /* don't bother reclaiming if it's only a small amount */
-                    if ((pool->possibly_reclaimable * pool->reclaim_factor +
-                         pool->guaranteed_reclaimable) > size) {
-                        (*pool->compact) (interp, mem_pools, pool);
-                    }
-                }
-            }
-        }
+        /* Compact the pool if allowed and worthwhile */
+        if (pool->compact)
+            (*pool->compact) (interp, mem_pools, pool);
+
         if (pool->top_block->free < size) {
             if (pool->minimum_block_size < 65536 * 16)
                 pool->minimum_block_size *= 2;
@@ -350,9 +329,9 @@ mem_allocate(PARROT_INTERP,
     }
 
     /* TODO inline the fast path */
-    return_val             = pool->top_block->top;
-    pool->top_block->top  += size;
-    pool->top_block->free -= size;
+    return_val              = pool->top_block->top;
+    pool->top_block->top   += size;
+    pool->top_block->free  -= size;
     mem_pools->memory_used += size;
 
     return return_val;
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to