partcl pmc usage.

Will Coleda will at coleda.com
Tue Dec 30 16:28:14 UTC 2008


On Tue, Dec 30, 2008 at 11:24 AM, Will Coleda <will at coleda.com> wrote:
> Without a profiler (or the current tuits to build one), I was
> wondering how I could best focus my efforts on making partcl go faster
> and use less memory. (I'm sure there are cuts to be made both in
> partcl and parrot), so now I have a local mod that dumps out
> interpinfo after each tcl command is executed. The last run for this
> bit of tcl:
>
> proc fact { number } {
>  set val 1
>  while {$number}  {
>    set val [expr {$val * $number}]
>    incr number -1
>  }
>  return $val
> }
>
> for {set i 0} {$i<500} {incr i} {
>  set a [fact 10]
> }
> puts "Factorial of 10 is $a"
>
> shows:
>
>    TOTAL_MEM_ALLOC............: 8266564
>    DOD_RUNS...................: 115
>    COLLECT_RUNS...............: 115
>    ACTIVE_PMCS................: 2871369
>    ACTIVE_BUFFERS.............: 2807713
>    TOTAL_PMCS.................: 3096542
>    TOTAL_BUFFERS..............: 2812089
>    HEADER_ALLOCS_SINCE_COLLECT: 0
>    MEM_ALLOCS_SINCE_COLLECT...: 0
>    TOTAL_COPIED...............: 142490896
>    IMPATIENT_PMCS.............: 0
>    LAZY_DOD_RUNS..............: 0
>    EXTENDED_PMCS..............: 6506
>
> That's nearly 3 million active PMCs; I'm sure there's some overhead
> for the partcl runtime, but that seems a bit excessive. Any
> suggestions on how to figure out where these references are being
> kept? Is there something I can run to see what is holding references?

For comparison, here's the sole run from the script [puts hi] :

    TOTAL_MEM_ALLOC............: 4350628
    DOD_RUNS...................: 2
    COLLECT_RUNS...............: 2
    ACTIVE_PMCS................: 13046
    ACTIVE_BUFFERS.............: 12811
    TOTAL_PMCS.................: 23931
    TOTAL_BUFFERS..............: 34053
    HEADER_ALLOCS_SINCE_COLLECT: 0
    MEM_ALLOCS_SINCE_COLLECT...: 0
    TOTAL_COPIED...............: 4196048
    IMPATIENT_PMCS.............: 0
    LAZY_DOD_RUNS..............: 0
    EXTENDED_PMCS..............: 4742

-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list