On Tue, Aug 23, 2005 at 10:11:37AM -0700, Larry Wall wrote:
> setting up the proxy hash. It's possible that COW hashes can be made
> to work efficiently. We'll need to copy hashes if we want to modify
> them to pass to subfunctions, just as when you change your environment
> it doesn't affect your parent process's environment variables.
I would assume that for parrot, with vtables, a "simple" COW hash would be
very efficient. By simple, I mean one that does a complete copy and separation
the first time someone tries to write to one of the "copies", rather than the
more complex concept of maintaining state on partial copies.
My hunch would be that a "simple" system of COW plus an overlay hash would
work very well for the case of adding to (or deleting from) a hash passed in
as default arguments, because 95% of the time that hash is only directly
manipulated by functions back up the call frame, so for the duration of the
call would be unchanged.
But this is all arm-wavy, and needs real code to analyse before committing
to it as a strategy.