On Fri, May 10, 2002 at 12:12:41PM -0400, Dan Sugalski wrote: > At 5:38 PM +0200 5/10/02, Peter Gibbs wrote: > >The result is that the last header of a COWed string will still believe that > >the buffer is shared until a GC collection run occurs, and therefore could > >result in buffers being copied unnecessarily. Your system eliminates this > >problem; however, I believe that Dan may be averse to using a linked list - > >we'll see. > > As long as there's no externally visible signs of the COW stuff, I > don't care as long as the code's commented well enough to be > maintained. I'd prefer commits of the code to be done only when > there's a demonstrable win to the committed code, though. (Which is > to say "No checking in code that slows things down") > > If you want to take an intermediate step, it's fine to mark > substrings that don't start at the beginning of a buffer with an > extra flag of some sort (BUFFER_COW_substring_FLAG or something) that > caused the GC system to make a clean copy when it ran through the > buffer pool and collected, though that has issues of properly gaguing > how much memory's needed for the new pool.
One of the performce benefits in perl is that it holds a pointer to the start of the buffer and an offset to the statr of the string data. This is a great benefit when trimming the start off strings. Why would parrot not need this ? And if it did, could you not use it for COW substrings ? Graham. [You has a lot of catching up todo]