GH-106485: "Un-materialize" __dict__s in LOAD_ATTR_WITH_HINT#106496
GH-106485: "Un-materialize" __dict__s in LOAD_ATTR_WITH_HINT#106496brandtbucher wants to merge 9 commits intopython:mainfrom
__dict__s in LOAD_ATTR_WITH_HINT#106496Conversation
|
Stats: https://github.com/faster-cpython/ideas/blob/main/stats/pystats-2023-07-07-brandtbucher-0ab8274.md |
|
There a few scenarios that we should consider. Here are the two I'm concerned about:
In case 1, we will repeatedly materialize and dematerialize the It is case 2 that matters, IMO. We need to keep the relevant That suggests to me that dematerialization should occur in the specializer and, more importantly, in the deopt path of In |
|
According to the stats comparison, the number of So this is incredibly effective, but the results do suggest that some (Sorry, it looks like there aren't public links for these results.) |
See my comment above: the numbers suggest that the
I think this should stay out of the specializer, since that runs infrequently and only sees the first instance of a class at a given location. I'll try the |
|
Something about my merge messed up the diff, I think... |
__dict__s if possible__dict__s in LOAD_ATTR_WITH_HINT
|
#106539 is an alternative to this, using |
|
Closing in favor of #106539. |
There's a failure path in the specialized bytecode that is often hit by objects that have a materialized
__dict__, but probably don't need it anymore.I'm running the benchmarks and gathering stats to see how promising this approach is.
__dict__s #106485