[Python-Dev] Unicode mapping tables

M.-A. Lemburg mal@lemburg.com
Tue, 29 Feb 2000 19:22:47 +0100


"M.-A. Lemburg" wrote:
> 
> I am just coding the translate method for Unicode objects and
> have come along a design question that may have some importance
> with resp. to speed and memory allocation size.
> 
> Currently, mapping tables map characters to Unicode characters
> and vice-versa. Now the .translate method will use a different
> kind of table: mapping integer ordinals to integer ordinals.
> 
> Question: What is more of efficient: having lots of integers
> in a dictionary or lots of characters ?

Turns out that integers are more flexible after some tests...
I'll stick with them :-)

Perhaps we could bump the small int optimization limit to
256 (it is currently set to 100) ?! This would be ideal for
these tables, since then at least most of the keys would
be shared between tables.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/