Hacker News new | ask | show | jobs
by cutler 588 days ago
Speed is still a major issue with Raku. Parsing a log file with a regex is Perl's forte but the latest Raku still takes 6.5 times as long as Python 3.13 excluding startup time.
1 comments

You'd need to qualify that with an example. In my experience some things are faster in Raku and some are slower, so declaring that "Raku takes 6.5 times as long as Python 3.13" is pretty meaningless without seeing what it's slower at.
I specified the use case so why "meaningless"? Here's the code:

    Raku
    for 'logs1.txt'.IO.lines -> $_ { .say if $_ ~~ /<<\w ** 15>>/; }

    Python
    from re import search
    with open('logs1.txt', 'r') as fh:
        for line in fh:
            if search(r'\b\w{15}\b', line): print(line, end='')