[New-bugs-announce] [issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

STINNER Victor report at bugs.python.org
Mon Apr 7 11:10:44 CEST 2014


New submission from STINNER Victor:

In issue #21118, I optimized str.translate() in Python 3.5 for ASCII 1:1 mapping and ASCII deletion. My optimization is not used if a character is replaced with a string (ex: "abc".translate({ord('a'): "xxx"})) and for non-ASCII strings.

translate_script.py is a simple benchmark for 1:1 mapping. It should be enhanced to benchmark also replacement strings.

----------
files: translate_script.py
messages: 215677
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Optimize str.translate() for replacement with substrings and non-ASCII strings
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file34745/translate_script.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21165>
_______________________________________


More information about the New-bugs-announce mailing list