cperl icon indicating copy to clipboard operation
cperl copied to clipboard

small string

Open rurban opened this issue 9 years ago • 1 comments

Store the PV bytes directly in the head, no body, just a simple short 3-15 char asciiz string. So far 7 with 64bit. Similar as Mike Pall's lua patch or my p2 variant, just easier, as we already have a free sv_any ptr to the string. And if we move the sv_flags before the refcnt, and use most refcnt bytes (leaving one, with the highest bit for this special case), we can store more than just 3 chars for 32bit and 7 chars for 64bit. max 4 more on 32bit and 8 more on 64bit.

rurban avatar Apr 30 '16 22:04 rurban

Note that davem had the same idea, maybe he even looked at cperl. And he implemented a new SVt_SHPV datatype: branch davem/shpv_poc https://perl5.git.perl.org/perl.git/shortlog/refs/heads/davem/shpv_poc

rurban avatar Apr 08 '17 18:04 rurban