Move CowREFCNT int away from PV #8

Open
rurban opened this Issue Sep 11, 2015 · 3 comments

Projects

None yet

1 participant

@rurban
Member
rurban commented Sep 11, 2015

This disallowed using static strings in B::C since 5.18.
We really need static strings for the shared keys and filenames.
When done, we could eventually be even better than 5.14, storing more COW (now "real cow")
strings than before.

CowREFCNT: seperate from string, share with sv_refcnt

For read-only strings (i.e. embedded and with the compiler) and with threads
it makes no sense to share the volatile cowrefcnt with the read-only buffer of the
string. We cannot use strings as read-only, and cannot compile them into a
constant segment, we even need to them to be initialized dynamically. This is one
of the reasons why the compiler is not performant since 5.18 anymore

Maybe: Add PV* and STRUCT_PV as alternative view of an SV*, add PvREFCNT() to make
it clear. PVs are all structs starting with xpv, just not AV, HV, IO as they have no cowable strings.

Add stats for highest SvREFCNT and CowREFCNT with -DC at the end.

Result with the core testsuite:
Typically 820 refcnt (the "_>file" GV), 5 cow

Highest outliers:
t/re/uniprops.t
== max refcnt: 118480 max cowrefcnt: 255
t/porting/podcheck.t
== max refcnt: 6121 max cowrefcnt: 255

See https://github.com/perl11/cperl/commits/feature/CM-600-cperl-cowrefcnt

@rurban rurban self-assigned this Sep 11, 2015
@rurban rurban added the compiler label Sep 11, 2015
@rurban
Member
rurban commented Sep 11, 2015

Reini Urban logged work - 2015-07-15 2:15 PM
Time Spent: 2 days

added a stats branch feature/CM-600-cperl-cowrefcnt-stats
added a feature branch with split U8:U24
this almost works, still some wrong string end somewhere.
worked on another U16:U16 split, but this failed
worked on another new PV* branch (sv_cowrefcnt only with strings),
but this is very questionable, as all the API calls have to be changed.

@rurban
Member
rurban commented Sep 11, 2015

logged work - 2015-07-17 9:10 AM - edited
Time Spent: 2 days

With commit 342dfb3db407c42542f3416a51a5fd794da2e264
Author: Reini Urban rurban@cpanel.net
Date: Mon Jul 13 19:31:29 2015 +0200
CowREFCNT: new sv_cowrefcnt, shared with sv_refcnt
The tests pass now with DEBUGGING, but fail without

@rurban
Member
rurban commented Sep 11, 2015

logged work - 2015-07-19 3:48 PM
Time Spent: 2 days

Fixed a couple of more issues:
fixed non-DEBUGGING in ext/re
fixed DynaLoader error message (missing symbol in re)
globvar fixed
remaining error: COW regression t/perf/speed.t, i.e. big string not COW'ed.

@rurban rurban added this to the v5.24.0 milestone Sep 13, 2015
@rurban rurban modified the milestone: v5.26.0, v5.24.0 May 10, 2016
@rurban rurban added the in progress label Dec 1, 2016
@rurban rurban added ready and removed in progress labels Jan 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment