I still have a few problems to iron out, but here come the stupid benchmarks: To do COW with a refcount stored in the string buffer, we have to check that SvLEN is at least two bytes greater than SvCUR and than the reference count has not reached 255. That overhead slows down COW. perl.git is the COW version. perl.git-copy is the non-COW version. Short string: Pint:perl.git sprout$ time ./miniperl -e '$x = "hello"; $y = $x for 1..10000000' real 0m3.137s user 0m3.128s sys 0m0.006s Pint:perl.git-copy sprout$ time ./miniperl -e '$x = "hello"; $y = $x for 1..10000000' real 0m2.597s user 0m2.587s sys 0m0.006s No cow is clearly the winner. Long string: Pint:perl.git sprout$ time ./miniperl -e '$x = "hello"x1000; $y = $x for 1..10000000' real 0m3.139s user 0m3.128s sys 0m0.008s Pint:perl.git-copy sprout$ time ./miniperl -e '$x = "hello"x1000; $y = $x for 1..10000000' real 0m7.533s user 0m7.520s sys 0m0.009s For cow, the speed is the same. For no cow, things are clearly slower. Harness is hanging for some reason, but minitest works so far. ‘make test’ has a few failures. You can play with it if you want. It’s on the sprout/ookow branch (SvOOK-style COW [except it does not involve SvOOK any more]). -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=114820Thread Next