[issue11313] Speed up default encode()/decode()

2012-11-09 Thread Ezio Melotti
Ezio Melotti added the comment: Agreed, closing. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed versions: +Python 3.4 ___ Python tracker _

[issue11313] Speed up default encode()/decode()

2012-11-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think a comment explaining that default encoding is utf-8 in python 3.x will improve readability of this code. if (encoding == NULL) return PyUnicode_DecodeUTF8(s, size, errors); seems quite self-explanatory. -- __

[issue11313] Speed up default encode()/decode()

2012-11-03 Thread A.M. Kuchling
A.M. Kuchling added the comment: MAL suggested adding "a comment explaining why this can be done". If Alexander or someone wants to do that, great! Otherwise, there seems no other reason to leave this issue open. -- nosy: +akuchling ___ Python tra

[issue11313] Speed up default encode()/decode()

2012-09-26 Thread Ezio Melotti
Ezio Melotti added the comment: Can this be closed? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue11313] Speed up default encode()/decode()

2011-04-12 Thread Ezio Melotti
Ezio Melotti added the comment: > Committed issue11313.diff in revision 88553. The revision number seems to be wrong -- maybe the commit got lost during the mercurial migration. All the changes of the patch seem to be there though, even if they went in with other commits: unicodeobjects.c:

[issue11313] Speed up default encode()/decode()

2011-02-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Alexander Belopolsky wrote: > > New submission from Alexander Belopolsky : > > In Python 3.x default encoding is always utf-8, but encode()/decode() still > try to look it up. Attached patch eliminates a call to normalize_encoding > and several strcmp()

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed issue11313.diff in revision 88553. On the second thought, the getargs optimization is not worth the trouble because in existing sources 'e' code is used with constant encodings and one is unlikely to pass NULL as an encoding because that is eq

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Thanks for the review and the tests. I have found one more place that can be easily optimized. (See patch below.) The decode() methods in bytes and bytearray are not so easy unfortunately because for some reason they are written to accept any object a

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Ezio Melotti
Ezio Melotti added the comment: Patch looks good. I checked the tests and couldn't fine any test for .encode()/.decode() without encoding, so I added them in the attached patch. -- components: +Interpreter Core stage: -> commit review Added file: http://bugs.python.org/file20881/issue

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : In Python 3.x default encoding is always utf-8, but encode()/decode() still try to look it up. Attached patch eliminates a call to normalize_encoding and several strcmp() calls. -- files: default-encode.diff keywords: patch messages: 129318 n