[New-bugs-announce] [issue15092] Using enum PyUnicode_Kind

Serhiy Storchaka report at bugs.python.org
Sun Jun 17 11:21:07 CEST 2012


New submission from Serhiy Storchaka <storchaka at gmail.com>:

Now a string kind declared in different places of code as `enum PyUnicode_Kind`, `int` or `unsigned int`. Working on the codecs optimization, I noticed that sometimes the use of `enum PyUnicode_Kind` gives a little advantage over the use of int's. Probably this hint allows compiler to better utilize the optimizer. The proposed patch replaces all string kind's declarations of local variables and private functions to `enum PyUnicode_Kind`. If this will not impact significantly on the performance, then at least the unification will enhance the readability and will allow to avoid some of the errors (missing switch cases).

----------
components: Interpreter Core
files: enum_PyUnicode_Kind.patch
keywords: patch
messages: 163043
nosy: storchaka
priority: normal
severity: normal
status: open
title: Using enum PyUnicode_Kind
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file26033/enum_PyUnicode_Kind.patch

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


More information about the New-bugs-announce mailing list