develooper Front page | perl.perl5.porters | Postings from July 2012


Thread Previous
Father Chrysostomos
July 1, 2012 13:25
Message ID:

On Jun 23, 2012, at 10:16 AM, Reini Urban wrote:

> On Wed, Jun 20, 2012 at 11:53 AM, Father Chrysostomos <> wrote:
>> Dave Mitchell asked:
>>> Whatever happened to PERL_COPY_ON_WRITE? Was it a failure? Should
>>> it be expunged, or revived? Or left to rot?
>> I asked the same question on the eleventh of December.  I am still
>> awaiting a response.
> I don't think it was a failure. We have now shared strings for
> bareword hash keys, files and stash names in strtab already.
> The remaining problem as I see it, is how to apply that to the general
> case for which strtab might not scale and be overkill.
> And as Nick wrote, rewrite his old COW on top of those new shared hash keys.

To put existing strings in the string table, each has to be allocated as a shared_he, which means padding the beginning with 20 bytes on 32-bit platforms.

I tried doing that and found that the bookkeeping overhead outweighed the cost of copying most of the time.

The ‘OLD’ copy-on-write system works parallel to string tables, by linking SVs in a loop when the PV needs to be copied from one to another, instead of actually copying it.  I think it would be faster than the string table in general.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About