[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--
components: Interpreter Core
files: test.py
messages: 380370
nosy: Kevin Modzelewski, pablogsal
priority: normal
severity: normal
status: open
title: LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file49568/test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com