Branch: refs/heads/yves/test_sawampersand
  Home:   https://github.com/Perl/perl5
  Commit: b53680b6d826a3d9f1a4078f25f40ef56ed87c83
      
https://github.com/Perl/perl5/commit/b53680b6d826a3d9f1a4078f25f40ef56ed87c83
  Author: Yves Orton <demer...@gmail.com>
  Date:   2023-07-27 (Thu, 27 Jul 2023)

  Changed paths:
    M .github/workflows/testsuite.yml

  Log Message:
  -----------
  testuite.yml - add PERL_SAWAMPERSAND testing

PERL_SAWAMPERSAND is related to how perl handles the use of $`, $& and
$' and the behavior of the regex engine. When it is defined then
certain slow copy operations are avoided UNLESS the code uses one of
these magic variables. This can have drammatic performance consequences
for certain code patterns, for example in while (//g) matching
against long strings.

When COW strings were introduced it was assumed that COW would be a
better solution to pessimizing the regex engine when these variables
were used, and for many code cases it is indeed more efficient. However
it is not a universal and consistent solution and there are cases where
matches that would be linear under PERL_SAWAMPERSAND are quadratic
without it. For those cases we support building perl with
PERL_SAWAMPERSAND defined so we do not rely on COW to deal with these
copy operations alone.

Since the default build is to not define PERL_SAWAMPERSAND code that
is governed by this build mode is not tested under normal
circumstanctes. This patch ensures that we test that code as well as
the default build mode.

>From time to time people suggest that we remove PERL_SAWAMPERSAND and
simply rely on COW, however I believe that this is unwise. COW does not
apply to all strings, and COW only supports 254 copies of a string, so
some operations actually would end up quadratic. The situation is
unsatisfactory IMO, and until we can make COW more powerful than it is I
believe we should continue to support the escape hatch represented by
PERL_SAWAMPERSAND which implies testing it.


Reply via email to