[Patches] [ python-Patches-416953 ] Speed up ASCII decoding
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 17 Apr 2001 23:04:31 -0700
Patches item #416953, was updated on 2001-04-17 22:37
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416953&group_id=5470
Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
Summary: Speed up ASCII decoding
Initial Comment:
In code that supports both byte and unicode strings,
mixing unicode strings with plain character constants
is frequent. E.g. both sre_compile and xmlproc look for
specific characters in an input string. Every usage of
such a character requires default decoding, which will
create a temporary Unicode object.
This patch caches Unicode objects that represent ASCII
characters. On the benchmark
import time
u = u""
t=time.time()
for i in xrange(1000000):
u+"("
print time.time()-t
it shows a 10% speed-up.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2001-04-17 23:04
Message:
Logged In: YES
user_id=21627
Attach patch.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416953&group_id=5470