cperl
cperl copied to clipboard
small string
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.
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