| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
This can be done for class lookups as well so things like Foo.bar() where bar is a classmethod gets constant folded. |
Sorry, something went wrong.
|
I don't see any change in deltablue, but that's because it's using cls.classmethod() instead of self.classmethod(). Would you like to add that to this PR as well? https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_deltablue/run_benchmark.py#L234 |
Sorry, something went wrong.
This turned out to be harder than I thought, because it would fold the classmethod descriptor into a unbound method lookup rather than a bound one, which changes the following CALL_BOUND_METHOD_EXACT_ARGS in the trace. |
Sorry, something went wrong.
|
The outer else doesn't set self_or_null[0], intentional? |
Sorry, something went wrong.
That shouldn't be a problem for staticmethod though, as self_or_null is always NULL. It would make sense for LOAD_ATTR 1 for classmethod to be leaving func cls on the stack. If we special case classmethod in _PyObject_GetMethodStackRef, it should add negligible overhead in the interpreter (possibly speeding things up if classmethods are common) and will enable this optimization in the JIT. |
Sorry, something went wrong.
Working on that. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
This PR is superseded by #157011, a newer open pull request for the same issue (gh-131798), and it no longer merges cleanly. Closing to cull the number of open pull requests. Do not reopen this pull request without getting a go-ahead from a triager or core developer. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Script used for benchmark: