This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: str.split optimization for one character separaters
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: hyeshik.chang Nosy List: hyeshik.chang
Priority: normal Keywords: patch

Created on 2003-12-29 03:21 by hyeshik.chang, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-strsplit.diff hyeshik.chang, 2003-12-29 03:21 a patch
Messages (2)
msg45077 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2003-12-29 03:21
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
msg45078 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2004-01-05 00:30
Logged In: YES 
user_id=55188

Committed as string_tests.py 1.37 and stringobject.c 2.217
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39736
2003-12-29 03:21:45hyeshik.changcreate