New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up ASCII decoding #34362
Comments
In code that supports both byte and unicode strings, This patch caches Unicode objects that represent ASCII import time
u = u""
t=time.time()
for i in xrange(1000000):
u+"("
print time.time()-t it shows a 10% speed-up. |
Logged In: YES Attach patch. |
Logged In: YES I knew this would come one day :-) The patch looks OK, but please also add proper init and |
Logged In: YES Committed as 2.83 of unicodeobject.c, with the requested |
Logged In: YES Reopened, since the previous patch broke test_unicodedata. In this version, the cache is only consulted in DecodeASCII, |
Logged In: YES I've added an alternative patch, which does return shared |
Logged In: YES Thanks for the update. Digging a little deeper into the I will work on this during the week and get back to you next |
Logged In: YES Checked in a modified patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: