Just to complete this thread, I have committed the current version of my
COW code, as I promised earlier this week. Below is my response to Peter's
most recent email.

> > Note that the comparison against parrot-grey is not
> > exactly fair, because it dodn't use system stackwalking.
>
> Note that I have only commented out the call to the stackwalk
> function - for COW benchmarking purposes you could always
> reinstate it. But that is beside the point now - your COW has
> been fixed, and the benchmarks confirm that gc_generations
> is equally unfriendly to all cows. There will always be programs
> that don't benefit and therefore only get the overhead - but in
> typical perl usage, I would expect that the majority of programs
> will benefit significantly, for example regex capture will be able
> to use COWed substrings.

Yeah, regex capture should be benefit *big* from COW. It also technically
helps make strings act more perl5-like, where you may easily chop
characters off the front and end of the string without reallocation. We
could even have the non-COW copy collection use strstart and strlen to
compact memory usage, giving the best of both worlds for those kinds of
applications.

> This should finally bring about the demise of grey, as I don't
> believe there is room for two totally different implementations
> of COW, and my buffer linked list, which is already expensive,
> gets absurdly so with the addition of strstart also.

This saddens me, and I hope it's not a permanent death. Grey was a very
good sanity check for me, at least. It caused us to get a 20% performance
in stackwalking (I think), motivated me to improve parrot's cow abilities
and performance, and was in general a good wake-up call that some of our
decisions were having a negative impact, and should be reconciled.

In reality, all that differs between grey's cow and mine, is that mine
allows for COWing of substrings with constant strings, and has a modified
string.c interface that improves clarity, imo. Fundamentally, it's the
original COW you provided a long time ago. I'd hate to make you
discontinue your side project because I committed a different
implementation of COW that wasn't directly compatible.

If you don't mind, please feel free to continue your work on parrot-grey.
I'd love to see the other ideas you had mentioned in your previous emails
that hadn't yet made it to grey, as some of them didn't sound entirely
illegal. You said that parroy grey was a fun project to play around
with performance numbers, and I'd hate to be the reason you stopped having
fun. :)

Thanks,
Mike Lambert



Reply via email to