|
|
|
|
|
by masklinn
4860 days ago
|
|
> The first example is lookup based on name, you can get away from that in python with slots You can get away from that with a sufficiently smart JIT turning a stable access to a known object into little more than a vtable dispatch. That's close to what V8 does with hidden classes on full cache hits (object map — its "hidden class" — + object "array" property both cached). point.x
will generate the assembly: cmp [ebx,<hidden class offset>],<cached hidden class>
jne <inline cache miss>
mov eax,[ebx, <cached x offset>]
(where ebx is the previously loaded `point`) |
|