eliben / pss

pss is a power-tool for searching inside source code files.
Other
327 stars 46 forks source link

A simple optimization #20

Closed rphilips closed 8 years ago

rphilips commented 10 years ago

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

eliben commented 10 years ago

Did you measure the performance increase from this optimization?

rphilips commented 10 years ago

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

eliben commented 10 years ago

OK, I see now. Can you create a pull request with this?

eliben commented 8 years ago

Closing for lack of interest. Feel free to reopen or create a new issue if this is still relevant