Title: Speed charmap encoder
Type: Stage:
Components: Interpreter Core Versions:
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: lemburg Nosy List: jackdied, lemburg, loewis
Priority: normal Keywords: patch

Created on 2005-11-18 08:00 by loewis, last changed 2006-06-04 19:37 by loewis. This issue is now closed.

File name Uploaded Description Edit
encode2.diff loewis, 2005-11-18 08:00
Messages (4)
msg49065 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-11-18 08:00
This patch speeds up the charmap encoder by a factor of 4 to 5, using a 
trie structure instead of a dictionary; the speedup primarily comes from 
not creating integer objects in the process.

The trie is created by inverting the encoding map; the codec generator is 
changed to drop the encoding dictionary, and instead emit a function call 
to create the trie.
msg49066 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2006-05-25 22:45
Logged In: YES 

Updated the patch as part of NeedForSpeed
(mainly Py_ssize_t changes and some rejected chunks)

Because the previous version on the trunk was
broken I'm not sure what to compare the results against ;)
msg49067 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2006-05-26 12:00
Logged In: YES 

Hi Martin,

I've only had a quick look at the patch, but it looks nice,
so please check it in.

Don't we also have to regenerate all the codecs once this
patch has been applied ?! If so, I can take care of that
using Makefile approach in Tools/unicode/. Please let me know.

msg49068 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-06-04 19:37
Logged In: YES 

Thanks for all comments and reviews; I have now committed
the patch as r46648. This includes a regeneration of the
individual codecs.
Date User Action Args
2005-11-18 08:00:17loewiscreate