Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: e3b0f74b8368e302993dcab22ba6d42613dd8ef5
https://github.com/Perl/perl5/commit/e3b0f74b8368e302993dcab22ba6d42613dd8ef5
Author: Richard Leach <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
M sv.c
Log Message:
-----------
Perl_sv_backoff - only copy the buffer contents if SvOK(sv)
When undoing an OOK, `Perl_sv_backoff` will always copy the shifted buffer
contents down to the start of the buffer. That's required when the contents
are live, unfortunate when the contents are defunct but tiny, and can have a
noticeably bad effect on performance when the contents are defunct but large.
See https://github.com/Perl/perl5/issues/23967 for an example of the latter.
With this commit the copy will only occur if `SvOK(sv)`. This test is expected
to indicate whether the buffer contents are active or defunct.
Commit: 4342210875c1fea7efb91105b1d600cbea2cc012
https://github.com/Perl/perl5/commit/4342210875c1fea7efb91105b1d600cbea2cc012
Author: Richard Leach <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
M scope.c
Log Message:
-----------
Perl_leave_scope - sv_backoff shouldn't do an unnecessay string copy
When a `my` SV goes out of scope, any OOK hack on its string buffer is
undone by `Perl_sv_backoff`. If the SV is `SvOK`, a copy of the buffer
contents will occur, but since the contents are defunct at this point,
the copy is unnecessary.
See https://github.com/Perl/perl5/issues/23967 as an example of where
this unnecessary copy had a noticeable effect on performance.
This commit essentially inlines the necessary parts of `sv_backoff` to
avoid the copy, without excessive messing around with `sv`'s flags at
the call site in `Perl_leave_scope`.
Commit: c8c2426c21c92620ec98c0e3309b732188960e5a
https://github.com/Perl/perl5/commit/c8c2426c21c92620ec98c0e3309b732188960e5a
Author: Richard Leach <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
M pod/perldelta.pod
Log Message:
-----------
Perldelta for GH#23968: OOK buffer copy only when SvOK(sv)
Compare: https://github.com/Perl/perl5/compare/dd8309d23d71...c8c2426c21c9
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications