Closed rphilips closed 8 years ago
Did you measure the performance increase from this optimization?
On 11/20/2013 05:10 PM, Eli Bendersky wrote:
Did you measure the performance increase from this optimization?
— Reply to this email directly or view it on GitHub https://github.com/eliben/pss/issues/20#issuecomment-28902420.
Hi,
with optimization I did not mean in the sense of performance, but just that more search patterns could be handled with str.find.
A long time ago, I did look into the str.find of Python and I found it to be a tremendous piece of software.
BTW contentmatcher.py is a very fine search software. I'm looking to add replace facilities.
Richard
OK, I see now. Can you create a pull request with this?
Closing for lack of interest. Feel free to reopen or create a new issue if this is still relevant
Hi,
Two things to consider:
in contentmatcher.py: implement _pattern_is_simple as:
def _pattern_is_simple(self, pattern): """ A "simple" pattern that can be matched with str.find and doesn't require a regex engine. """ return re.escape(pattern) == pattern