Front page | perl.perl6.internals |
Postings from April 2005
Re: parrot and refcounting semantics
Thread Previous
|
Thread Next
From:
Dan Sugalski
Date:
April 30, 2005 08:39
Subject:
Re: parrot and refcounting semantics
Message ID:
a06210200be994074ebb6@[192.168.0.8]
At 11:12 PM -0400 4/29/05, Bob Rogers wrote:
> From: Dan Sugalski <dan@sidhe.org>
> Date: Fri, 29 Apr 2005 15:23:47 -0400
>
> At 10:55 PM -0400 4/28/05, Bob Rogers wrote:
> > From: Robin Redeker <robin@nethype.de>
> >I'm astounded. Do neither of you ever design data structures with
> >symmetrical parent<->child pointers? No trees with parents? No
> >doubly-linked lists? In my (probably skewed) experience, circular
> >references are used frequently in languages like C or Lisp that don't
> >penalize them.
>
> I responded to Uri on this, but note that I said "neither are
> terribly common", and they aren't. Relative to the total number of
> GC-able things, objects in circular structures are a very small
> minority.
>
>I can think of many programs I've written or otherwise hacked on where
>this is not the case. In some cases, the majority of objects are
>directly circular (i.e. part of a cycle as opposed to being referenced
>from an object in a cycle). But I suppose that just means that we've
>worked on very different apps. Before Perl5, I used to use parent
>pointers at the drop of a hat. But, 'nuff said, I guess.
Actually I think you'll find that isn't the case, though it's easy to
overlook, and is probably mostly my sloppy terminology. Programs,
when they run, tend to create a lot of what I've been calling
objects, but for parrot they'd be PMCs, and not necessarily actually
real objects as such.
Languages parrot's going for -- perl, python, ruby, php, tcl, and
their ilk -- do chew through a lot temps. For the GC's purposes, and
mine, they count. When you add those in, the plain GCable thing count
tends to skyrocket. Yeah, the *important* data structures in a
program may be partly, or mostly, in circular structures, but the
hundred thousand temps that get created to hold intermediate values
are all uncircular things. This is definitely not the case for
languages like C++ where you're a lot closer to the metal, but we're
a bit further away from it here. (It'd be interesting, since parrot
*can* keep stats, to run some complex programs and see what the GC
numbers look like. I ought to turn it on for some of the
longer-running reports I have and see what there is to see, though
the results may be as much a condemnation of my compiler as anything
else. :)
--
Dan
--------------------------------------it's like this-------------------
Dan Sugalski even samurai
dan@sidhe.org have teddy bears and even
teddy bears get drunk
Thread Previous
|
Thread Next