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

Move CowREFCNT int away from PV #8

@rurban

Description

@rurban

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions