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

Stupid COW benchmarks ([perl #114820] Bleadperl v5.17.3-255-g6502e08 breaks SARTAK/Path-Dispatcher-1.04.tar.gz)

Thread Next
From:
Father Chrysostomos via RT
Date:
October 8, 2012 00:37
Subject:
Stupid COW benchmarks ([perl #114820] Bleadperl v5.17.3-255-g6502e08 breaks SARTAK/Path-Dispatcher-1.04.tar.gz)
Message ID:
rt-3.6.HEAD-11172-1349681836-291.114820-15-0@perl.org
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=114820

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About