"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/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4