Front page | perl.perl5.porters |
Postings from November 2016
Re: A possible new approach to COW - COW_META.
Thread Previous
|
Thread Next
From:
Dave Mitchell
Date:
November 7, 2016 09:12
Subject:
Re: A possible new approach to COW - COW_META.
Message ID:
20161107091204.GB3081@iabyn.com
On Sun, Nov 06, 2016 at 12:50:37PM -0800, Father Chrysostomos wrote:
> On Nov 6, 2016, at 7:13 AM, demerphq <demerphq@gmail.com> wrote:
> > Today I pushed a branch, yves/cow_meta.
> >
> > This branch is my take on reworking COW so it does not store the
> > refcount in the string.
>
> Have you benchmarked it at all? I tried something similar at first (but
> not quite as clean), and found that it made things slower than no COW at
> all.
Using the following benchmark file:
[
'sassign1' => {
desc => 'assign string length 1',
setup => 'my $s = "x" x 1; my $t;',
code => '$t = $s; $t = ""',
},
'sassign10' => {
desc => 'assign string length 10',
setup => 'my $s = "x" x 10; my $t;',
code => '$t = $s; $t = ""',
},
'sassign100' => {
desc => 'assign string length 100',
setup => 'my $s = "x" x 100; my $t;',
code => '$t = $s; $t = ""',
},
'sassign1k' => {
desc => 'assign string length 1000',
setup => 'my $s = "x" x 1_000; my $t;',
code => '$t = $s; $t = ""',
},
'sassign10k' => {
desc => 'assign string length 10_000',
setup => 'my $s = "x" x 10_000; my $t;',
code => '$t = $s; $t = ""',
},
'sassign100k' => {
desc => 'assign string length 100_000',
setup => 'my $s = "x" x 100_000; my $t;',
code => '$t = $s; $t = ""',
},
];
I get the following. bleadNC is blead built with -DPERL_NO_COW. These are
raw numbers - lower is better.
Key:
Ir Instruction read
Dr Data read
Dw Data write
COND conditional branches
IND indirect branches
_m branch predict miss
_m1 level 1 cache miss
_mm last cache (e.g. L3) miss
- indeterminate percentage (e.g. 1/0)
The numbers represent raw counts per loop iteration.
sassign1
assign string length 1
bleadNC blead yves
-------- -------- --------
Ir 478.0 499.0 656.0
Dr 155.0 155.0 222.0
Dw 74.0 74.0 111.0
COND 82.0 90.0 112.0
IND 13.0 13.0 9.0
COND_m 0.0 2.1 0.0
IND_m 8.0 8.0 6.0
Ir_m1 0.0 0.0 0.0
Dr_m1 0.0 0.0 0.0
Dw_m1 0.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
sassign10
assign string length 10
bleadNC blead yves
-------- -------- --------
Ir 480.0 626.0 656.0
Dr 156.0 210.0 222.0
Dw 75.0 107.0 111.0
COND 82.0 104.0 112.0
IND 13.0 9.0 9.0
COND_m 0.0 0.1 0.0
IND_m 8.0 6.0 6.0
Ir_m1 0.0 0.1 0.0
Dr_m1 0.0 0.0 0.0
Dw_m1 0.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
sassign100
assign string length 100
bleadNC blead yves
-------- -------- --------
Ir 492.0 626.0 656.0
Dr 161.0 210.0 222.0
Dw 80.0 107.0 111.0
COND 80.0 104.0 112.0
IND 13.0 9.0 9.0
COND_m 0.0 0.0 0.0
IND_m 8.0 6.0 6.0
Ir_m1 0.0 0.1 0.0
Dr_m1 0.0 0.0 0.0
Dw_m1 0.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
sassign1k
assign string length 1000
bleadNC blead yves
-------- -------- --------
Ir 649.0 626.0 656.0
Dr 218.0 210.0 222.0
Dw 136.0 107.0 111.0
COND 91.0 104.0 112.0
IND 13.0 9.0 9.0
COND_m 1.0 0.2 0.0
IND_m 6.0 6.0 6.0
Ir_m1 0.0 0.1 0.0
Dr_m1 0.0 0.0 0.0
Dw_m1 0.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
sassign10k
assign string length 10_000
bleadNC blead yves
-------- -------- --------
Ir 2059.0 628.0 656.0
Dr 781.0 208.0 222.0
Dw 699.0 107.0 111.0
COND 162.0 105.0 112.0
IND 13.0 9.0 9.0
COND_m 2.0 1.2 0.0
IND_m 6.0 6.0 6.0
Ir_m1 0.0 0.1 0.0
Dr_m1 0.0 0.0 0.0
Dw_m1 0.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
sassign100k
assign string length 100_000
bleadNC blead yves
-------- -------- --------
Ir 19254.0 628.0 656.0
Dr 6407.0 208.0 222.0
Dw 6324.0 107.0 111.0
COND 867.0 105.0 112.0
IND 13.0 9.0 9.0
COND_m 2.0 1.2 0.0
IND_m 6.0 6.0 6.0
Ir_m1 0.0 0.0 -0.1
Dr_m1 1605.0 0.0 0.0
Dw_m1 1569.0 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
AVERAGE
bleadNC blead yves
-------- -------- --------
Ir 3902.0 605.5 656.0
Dr 1313.0 200.2 222.0
Dw 1231.3 101.5 111.0
COND 227.3 102.0 112.0
IND 13.0 9.7 9.0
COND_m 0.8 0.8 0.0
IND_m 7.0 6.3 6.0
Ir_m1 0.0 0.1 -0.0
Dr_m1 267.5 0.0 0.0
Dw_m1 261.5 0.0 0.0
Ir_mm 0.0 0.0 0.0
Dr_mm 0.0 0.0 0.0
Dw_mm 0.0 0.0 0.0
--
"You may not work around any technical limitations in the software"
-- Windows Vista license
Thread Previous
|
Thread Next