| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Do you have stats for this PR? Stats: https://github.com/faster-cpython/ideas/blob/main/stats/pystats-2023-07-07-brandtbucher-0ab8274.md |
Sorry, something went wrong.
|
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 __dict__. Hopefully this case will be rare, so the performance impact will be acceptable. It is case 2 that matters, IMO. We need to keep the relevant LOAD_ATTRs specialized to LOAD_ATTR_INSTANCE_VALUES and at the same time dematerialize the __dict__s when we can. That suggests to me that dematerialization should occur in the specializer and, more importantly, in the deopt path of LOAD_ATTR_INSTANCE_VALUES. In LOAD_ATTR_INSTANCE_VALUES |
Sorry, something went wrong.
|
According to the stats comparison, the number of __dict__ materializations "on request" increased from 3.7 million to 3.9 million, but the number of dict "un-materializations" is 3.7 million. So this is incredibly effective, but the results do suggest that some __dict__s are "thrashing" back and forth in the mypy benchmark, which got 17% slower and pulled the (otherwise boring) results down to 0.6% slower. (Sorry, it looks like there aren't public links for these results.) |
Sorry, something went wrong.
See my comment above: the numbers suggest that the mypy benchmark does this, with quite painful results.
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 LOAD_ATTR_INSTANCE_VALUE flavor, though. |
Sorry, something went wrong.
|
Something about my merge messed up the diff, I think... |
Sorry, something went wrong.
|
#106539 is an alternative to this, using LOAD_ATTR_INSTANCE_VALUE. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.