develooper Front page | perl.perl6.users | Postings from March 2021

Re: [sf-perl] The SF Perl Raku Study Group, 03/28 at 1pm PDT

Thread Next
March 29, 2021 15:37
Re: [sf-perl] The SF Perl Raku Study Group, 03/28 at 1pm PDT
Message ID:
Hi Joe & other Raku study group attendees,

At the time I left, we were looking at a grammar with a speed-memory issue
on large-ish files. I had a germ of an idea which I couldn't express, and
from the meeting notes I see you have a simple fix *"by changing stuff
regex (.\*?) to non-greedy (.\*)*" I suspect the greedy-optimization works
because the thing after the "stuff" regex is near the end of the file. Thus
if instead it was close to the beginning, it would have a similar issue
with greedy and non-greedy would fix.

With a night to sleep on it, the thing I was thinking & trying to say is
that, in the specialized HTML-grammar you had, the decision points are all
at left-brackets. By re-writing "stuff" so that it will only backtrack when
it hits a bracket, I expect more speed-memory gains.

How well does this perform vs the simple .* greedy fix?

    regex stuff
    { (  # capture stuff (positional capture might not be needed)
        [               # Stuff is a group of either
            \<          # a left-bracket decision point
          ||            # or
            <-[ \< ]>+: # a ratcheting string of non-decision points
        ]*              # 0-many of those. Greedy or non-greedy both work?
    ) }  # end capture, end regex

This was harder to express verbally & in code than I expected!


On Sun, Mar 28, 2021 at 4:23 PM Joseph Brenner <> wrote:

> I did send this one out, but it doesn't seem that it went out exactly,
> so let's try this one more time.   The Study Group is happening,
> already in progress, though we'll be taking a break next week and
> broadcasting a burning yule log with the soundtrack to Jesus Christ
> Superstar.  (Just kidding)
> Flaming Carrot, "Night Patrol" (1986) by Bob Burden:
>     I feel it rising now...
>     ... like little bubbles...
>     ... in a full moon, your brain floats to top of your head...
>     I feel it...
>     beginning to boil...
>     a lot will happen tonight.
> The Raku Study Group
> March 28, 2021  1pm in California, 8pm in the UK
> Zoom meeting link:
> Passcode: 4RakuRoll
> RSVPs are useful, though not needed:
> _______________________________________________
> SanFrancisco-pm mailing list

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About