Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Move CowREFCNT int away from PV #8

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

Move CowREFCNT int away from PV #8

rurban opened this issue Sep 11, 2015 · 3 comments
Assignees

Comments

@rurban
Copy link
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
Copy link
Member Author

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
Copy link
Member Author

rurban commented Sep 11, 2015

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

With commit 342dfb3db407c42542f3416a51a5fd794da2e264
Author: Reini Urban [email protected]
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
Copy link
Member Author

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 milestones: v5.26.0, v5.24.0 May 10, 2016
@rurban rurban added ready and removed in progress labels Jan 8, 2017
@rurban rurban removed this from the v5.26.0c milestone Mar 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant