New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable interpolation in regex very slow #4954
Comments
From jules@jules.ukGiven Doing And if $s happened to contain anything other than literals, so I had to us my @matching = @lines.grep($s); The lack of Perl5's straightforward variable interpolation in regexs is crippling the speed. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @timoOn 12/29/2015 12:46 AM, Jules Field (via RT) wrote:
For now, you can use @lines.grep(*.contains($s)), which will be Ideally, our regex optimizer would turn this simple regex into a code Until then, we ought to be able to make interpolation a bit faster. |
From jules@jules.ukOn 29/12/2015 23:05, Timo Paulssen via RT wrote:
I would ideally also be doing case-insensitive regexps, but they are 50 But that's not something I want to do very often, far more frequently I Just thoughts from a big Perl5 user (e.g. MailScanner is 50k lines of it!). Jules -- 'If I were a Brazilian without land or money or the means to feed -- |
From @MasterDuke17On Thu, 31 Dec 2015 05:39:24 -0800, jules@jules.uk wrote:
I recently attempted to make interpolating into regexes a little faster. This is what I was using for a benchmark: This is Rakudo version 2017.09 built on MoarVM version 2017.09.1: This is Rakudo version 2017.09-427-gd23a9ba9d built on MoarVM version 2017.09.1-595-g716f2277f: However, if you type the string to interpolate it is *much* faster for literal interpolation. This is still nowhere near as fast as grep(*.contains($s)) though, which only takes 0.037s. |
From @MasterDuke17On Sun, 15 Oct 2017 05:19:54 -0700, ddgreen@gmail.com wrote:
This is Rakudo version 2017.10-143-g0e50993f4 built on MoarVM version 2017.10-58-gad8618468: |
From @MasterDuke17On Tue, 07 Nov 2017 17:10:29 -0800, ddgreen@gmail.com wrote:
Adding :i (case insensitive adverb), /:i $s / took 3.0s and /:i <$s> / took 7.7s. |
From @MasterDuke17On Tue, 07 Nov 2017 17:14:15 -0800, ddgreen@gmail.com wrote:
This is Rakudo version 2018.04.1-76-g9b915f09d built on MoarVM version 2018.04.1-98-g1aa02fe45 |
Migrated from rt.perl.org#127064 (status was 'open')
Searchable as RT127064$
The text was updated successfully, but these errors were encountered: