| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Oh there is a previous discussion: #76603. I'll check this. |
Sorry, something went wrong.
|
Mmh, so this now boils down to whether we want to make sure that the GC protocol is correctly implemented or if we want to keep performances. |
Sorry, something went wrong.
|
The lru_cache_type_spec already is marked with Py_TPFLAGS_HAVE_GC and Py_TPFLAGS_IMMUTABLETYPE. And the lru_cache_tp_traverse is already visiting all of the _lru_list_elem entries. ISTM that all parts that can hold an object are already visible to GC and would be collected at shutdown. This PR seems unnecessary and will just hurt performance for no real use benefit. |
Sorry, something went wrong.
There was a problem hiding this comment.
Concur with @rhettinger.
Note also that the cache dict is already visited, and it visits all its elements, so they will be visited twice with this PR.
Also, clearing the key in lru_list_elem_clear() can have bad consequences.
Sorry, something went wrong.
|
I see. Ok I'll close this one and will just change the immutability bit when necessary in the other PRs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This type is immutable but it is a true container type, so it needs the GC. However I need to measure performances.