It's disappointing to hear that Boehm is slower, but not entirely surprising either. Boehm is a "conservative" collector. It operates by essentially doing a linear walk over the stack and the heap, identifying values that *might* be valid pointers, and marking them. Parrot's current MS collector has some knowledge about where to look for pointers. That's what VTABLE_mark is for: A PMC knows where it's data is located, so we don't need to search the heap linearly.
That said, with the Boehm collector, we can probably remove VTABLE_mark entirely. I haven't looked at your branch yet to see if you are even still using it, but you shouldn't need to. Also the issue with the destruction is an issue I ran into too, and never found a suitable solution. Boehm does have some ability to run code on object destruction, but I wasn't able to find a reasonable way to make it do what Parrot needed. It's possible I didn't find all the right documentation. I'll take a look at the branch nowish and see what's going on. --Andrew Whitworth On Tue, Dec 29, 2009 at 8:00 AM, Vasily Chekalkin <[email protected]> wrote: > Hello. > > I created boehm_gc branch for... ahem.. bringing Boehm GC to Parrot. It's > almost work. Unfortunately it's _slower_ than current naive mark&sweep GC in > Parrot. Some results here > > ba...@icering:~/src/parrot$ time ./parrot --gc=boehm ext/nqp-rx/nqp-rx.pbc > fib.nqp > fib(28) = 317811 > > real 0m18.534s > user 0m16.673s > sys 0m1.372s > > ba...@icering:~/src/parrot$ time ./parrot ext/nqp-rx/nqp-rx.pbc fib.nqp > fib(28) = 317811 > > real 0m16.166s > user 0m15.565s > sys 0m0.120s > > ba...@icering:~/src/parrot$ cat fib.nqp > sub fib($n) { > ($n < 2) ?? $n !! fib($n-1) + fib($n-2); > } > > my $N := 28; > > pir::say("fib($N) = " ~ fib($N)); > > > I'm not quite familiar with Boehm GC, but my expectations were very > different. Looks like it doesn't reclaim any memory and marking it on any > GC_MALLOC call. > > So, I need help to understand what's going on. > > (BTW, branch passing almost all coretests except VTABLE_destroy based > FileHandle and NCI.) > > -- > Bacek > _______________________________________________ > http://lists.parrot.org/mailman/listinfo/parrot-dev > _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
