Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: dbe37414ccd0f34ff1638f49deb9955648e98099 https://github.com/Perl/perl5/commit/dbe37414ccd0f34ff1638f49deb9955648e98099 Author: Richard Leach <richardle...@users.noreply.github.com> Date: 2025-03-13 (Thu, 13 Mar 2025)
Changed paths: M sv.c Log Message: ----------- Perl_vnewSVpvf - use the pattern length to size the new PV buffer This function currently creates a new SVt_PV with a minimum string length buffer via: sv = newSV(1); Simple measurements from compiling perl show that this is often sufficient. When it isn't, the final buffer length is often close to strlen(pat). Common cases that require a realloc() now will not with this commit. In other cases, realloc()s will still be required, but the number will likely be smaller by one. Although min length & alloc behaviour can vary across platforms and compilers, the following numbers are likely indicative: |strlen(pat)|Inital SvLEN before|Initial SvLEN now|Final SvLEN| |-----------|-------------------|-----------------|-----------| |004|16|016|016| |058|16|060|060| |071|16|073|120| |104|16|106|106| |104|16|106|200| |122|16|124|124| |123|16|125|125| |123|16|125|168| |377|16|379|379| To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications