partcl pmc usage.

Will Coleda will at coleda.com
Tue Dec 30 16:24:11 UTC 2008


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?

-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list