[Python-ideas] Why CPython is still behind in performance for some widely used patterns ?

Yury Selivanov yselivanov.ml at gmail.com
Thu Feb 1 13:04:34 EST 2018


On Thu, Feb 1, 2018 at 12:55 PM, Brett Cannon <brett at python.org> wrote:
>
>
> On Thu, 1 Feb 2018 at 07:34 Pau Freixes <pfreixes at gmail.com> wrote:
[..]
>> 2) Regarding the Yuris proposal to cache bultin functions, why this
>> strategy cant be used for objects and their attributes within the function
>> scope? Technically which is the red flag?
>
>
> Descriptors are the issue for attributes. After that it's a question of
> whether it's worth the overhead of other scope levels (built-ins are
> somewhat unique in that they are very rarely changed).

I'm not sure I understand Pau's question but I can assure that my
optimizations were fully backwards compatible and preserved all of
Python attribute lookup semantics.  And they made some macrobenchmarks
up to 10% faster.

Unfortunately I failed at merging them in 3.7.  Will do that for 3.8.

Yury


More information about the Python-ideas mailing list