[Patches] [ python-Patches-573977 ] Speed-up shlex

noreply@sourceforge.net noreply@sourceforge.net
Fri, 28 Jun 2002 16:06:36 -0700


Patches item #573977, was opened at 2002-06-26 02:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=573977&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
>Resolution: Postponed
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: Speed-up shlex

Initial Comment:
Shlex spends a lot of its time testing whether a 
character is a commenter, wordchar, whitespace, or 
quote.  It currently tests for membership in a string, O
(n).  Tests for membership in a dictionary are much 
faster, O(1).  Even with a single member, 
__contains__ works faster on a dictionary than a 
string.


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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2002-06-28 18:06

Message:
Logged In: YES 
user_id=80475

Post-poned pending GvR review of the dict(seqn, value) 
patch.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-06-26 10:30

Message:
Logged In: YES 
user_id=80475

Here is a tiny patch for your review.


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=573977&group_id=5470