-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove get_id() hotspot #14108
base: master
Are you sure you want to change the base?
Remove get_id() hotspot #14108
Conversation
1c424d4
to
86b8f11
Compare
86b8f11
to
4a41939
Compare
These are given a name that is different from __func.__name__, so store the name when the descriptor is placed in the class. Signed-off-by: Paolo Bonzini <[email protected]>
4a41939
to
81d7421
Compare
I’d honestly love to see many of the get_* functions go. They either need a better name, or end up being a useless layer of indirection to return a property, which comes with a performance cost. incidentally I had been looking at this and the. Got bogged down adding type annotations to the vs backend… |
Absolutely. I'd also love to have a lazy_property variant that stores the outcome of a method in the If you'd like me to introduce an |
I think i'd rather have I'm fine with the |
81d7421
to
4b59905
Compare
Use lazy_property for get_id(). To avoid touching code all over the place, keep get_id() but make it access the actual lazy property (which will be simply an entry in self.dict)