Feature Requests item #1561634, was opened at 2006-09-19 12:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1561634&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Performance
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Submitted By: Nick Welch (mackstann)
Assigned to: Nobody/Anonymous (nobody)
Summary: String searching performance improvement

Initial Comment:
The current string searching (str.find) seems to use
the simplest possible method of searching, which is
simply comparing character by character.  A simple
speed improvement would be to take needle[-1] and start
searching at haystack[len(needle)-1].  Then check again
at haystack[len(needle)*2-1].  etc.  If the last
character doesn't match, then the rest of the string
couldn't possibly match.  I'm sure there are other
methods of speeding up string searching but this seems
like a pretty simple and easy improvement.  If I have
some time I will go ahead and try implementing it myself.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1561634&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to