zeusdeux / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Asking for substrings slows successful matches quite a bit. #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. re2 'search' for a given compiled pattern and string takes 10.1 microsecond 
without any group capturing. With 1 group capturing, it takes 3.46 ms.

What is the expected output? What do you see instead?
Substring capturing is slower than PCRE. In 're.h' it is mentioned that "This 
may get a little faster in the future, but right now is slower than PCRE.". Is 
the patch for faster version available now. If not, can you enlighten me how to 
achieve 'a little faster' substring capturing?

What version of the product are you using? On what operating system?
Latest version re2.

Please provide any additional information below.
NOTE: If you have a suggested patch, please see
http://code.google.com/p/re2/wiki/Contribute
for information about sending it in for review.  Thanks.

Original issue reported on code.google.com by suzan.sh...@gmail.com on 16 Mar 2012 at 8:39

GoogleCodeExporter commented 9 years ago
I don't have any tricks up my sleeve. See 
http://swtch.com/~rsc/regexp/regexp3.html for some notes about what's going on. 
It's as fast as I know how to make it.

Original comment by rsc@golang.org on 10 Jan 2014 at 1:23