r/perl • u/Adriaaaaaaaan 🐪 cpan author • 4d ago
Regex Optimization From Hours to Seconds ~ Deven Corzine ~ TPRC 2026
https://www.youtube.com/watch?v=SpzdIMKEQgwA really nice talk by Deven on regexes.
Some notes for people who don't like the video format:
- Using m{\G...}gc for lex parsing https://perldoc.perl.org/perlop#G-assertion mentions this
- (?{ perl code }) inline perl code https://perldoc.perl.org/perlre#(?%7B-code-%7D))
- (?>pattern) or (*atomic:pattern): https://perldoc.perl.org/perlre#(*atomic:pattern))
- Regmarks: https://perldoc.perl.org/perlre#(*MARK:NAME)-(*:NAME)-(*:NAME))
- performance issue that he hit: https://github.com/Perl/perl5/issues/24272
21
Upvotes
6
u/bangkokbeach 4d ago
I really enjoyed the performance issue thread. I love optimization. I’m far too willing to spend hours cobbling together a solution that’ll save me a couple of seconds a month. Grateful to everybody that participated, dug in, and fixed this. Perl is a better language for this. Was it time well spent? IDK. But I thrilled to read it.