[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-05 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 80449f243b13311d660eab3a751648029bcdd833 by Pablo Galindo in branch 'master': bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157) https://github.com/python/cpython/commit/80449f243b13311d660eab3a751648029bcdd833

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Yonatan Goldschmidt
Change by Yonatan Goldschmidt : -- nosy: +Yonatan Goldschmidt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +22068 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23157 ___ Python tracker

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: s/the attribute itself is a class/the attribute itself is in the class/ -- ___ Python tracker ___

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: We could also store the tag of the type object if is a descriptor and compare against that on the cache hit to check that our assumptions are valid. The price here would be an extra pointer on the cache per opcode that may not even be used most of

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Yury, any preference here? -- nosy: +yselivanov ___ Python tracker ___ ___

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Given that having attributes that are classes is quite uncommon, I think we can not optimize of the attribute itself is a class instead of checking for descriptors on every hit, hurting the performance gains --

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Good catch, Kevin! Would you like to submit a PR for fixing this? -- ___ Python tracker ___

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread pmp-p
Change by pmp-p : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42266] LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior

2020-11-04 Thread Kevin Modzelewski
New submission from Kevin Modzelewski : The problem is that the descriptor-ness of a type-level attribute is only checked at opcache-set time, not at opcache-hit time. $ python3.8 test.py 2 $ ./python --version Python 3.10.0a2+ $ git rev-parse --short HEAD 789359f47c $ ./python test.py 1