Hacker News new | ask | show | jobs
by kayamon 3643 days ago
While true, an aliasing 'miss' in C just causes a pointer reload, while the same miss in Python causes a hash table lookup.
1 comments

it causes much more than a hash table lookup: it causes an attribute lookup, which is ...

     1. an instance __dict__ lookup, 
     2. a __getattr__ call (itself involving another hash lookup)
     3. a class property lookup
     4. superclass property lookups (if there are any superclasses)
If it was just a hash table lookup, it would be LuaJIT2 fast. But it's more like 10 hash table lookups and indirections, and that's assuming you don't actually try to hook any of this machinery to do something.