[Patches] [ python-Patches-866875 ] str.split optimization for one character separaters

SourceForge.net noreply at sourceforge.net
Sun Jan 4 19:30:41 EST 2004


Patches item #866875, was opened at 2003-12-29 12:21
Message generated for change (Comment added) made by perky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=866875&group_id=5470

Category: Core (C code)
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Hye-Shik Chang (perky)
>Assigned to: Hye-Shik Chang (perky)
Summary: str.split optimization for one character separaters

Initial Comment:
Attached patch tries to optimize str.split by a
speciaiized splitter for one character separacters.
This trick is used for unicode.split too. I just
applied it to str.split. :)

quick perf. test:

- BEFORE -
% ./python Lib/timeit.py
'"/aaa/bbb/ccc/ddd/eee/fff/ggg/hhh/iii".split("/")'
100000 loops, best of 3: 7.84 usec per loop

- AFTER -
% ./python Lib/timeit.py
'"/aaa/bbb/ccc/ddd/eee/fff/ggg/hhh/iii".split("/")'
100000 loops, best of 3: 5.39 usec per loop


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

>Comment By: Hye-Shik Chang (perky)
Date: 2004-01-05 09:30

Message:
Logged In: YES 
user_id=55188

Committed as string_tests.py 1.37 and stringobject.c 2.217

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

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



More information about the Patches mailing list