Message 258220 - Python tracker (original) (raw)
I like this idea! I like the limitations to positional-only calls. I do think that it would be nice if we could speed up C calls too -- today, s.startswith('abc') is slower than s[:3] == 'abc' precisely because of the lookup. But I'm all for doing this one step at a time, so we can be sure it is solid before taking the next step(s).
Yes, I think we can make <built-in type>.method(..)
calls much faster with LOAD_METHOD. Since those types lack __dict__
and their __class__
is read-only, we can use a far better optimized code path without extra lookups and creation of BoundMethod/PyCFunction objects.