On Mon, Apr 21, 2025 at 06:55 <[email protected]> wrote:
> On Mon, Apr 21, 2025 at 07:34:13AM -0400, Greg Wooledge wrote:
> > On Mon, Apr 21, 2025 at 08:04:44 +0200, [email protected] wrote:
> > > [...] quite possibly Perl's engine has been refined (it definitely has
> > > been extended) since then.
>
> [...]
>
> > It still has the issue.
> >
> > hobbit:~$ time perl -e '$s = "a" x 25; $r = "a?" x 25 . "a" x 25; if ($s =~
> > $r) { print "yes\n"; }'
> > yes
> > real 1.354 user 1.349 sys 0.004
On my box I for that example using Perl l get:
> real 0.742 user 0.738 sys 0.004
If you install Raku (formerly Perl 6) you can try for comparison:
$ sudo aptitude install raku
Note Raku has some slightly different syntax for the same example:
$ time raku -e ‘my $s = “a” x 25; my $r = “a?” x 25 ~ “a” x 25; if
($s ~= $r) { say “yes” } ‘
Raku’s regular expression grammar is much better than Perl’s. Larry
was very picky about that.
Running the Raku one-liner on my box, I get:
> real 0.138 user 0.129 sys 0.004 # Rake v 2025.03
> real 0.742 user 0.738 sys 0.004 # Perl v5.32.1
Your Raku version on Debian is probably not the latest, but you should
see results better than Perl’s.
Best to all,
-Tom
-Tom