CPython VM internals - Wiki page

T

Terry Reedy

Various people have asked on c.l.p about documentation of CPython's
virtual machine internals. The usual answers have been to see the dis
module doc for bytecodes and 'read the code' for more. Jakob Sievers
did so and posted his notes, with additions from Martin v. Löwis, as

http://wiki.python.org/moin/CPythonVmInternals
 
J

John Nagle

Terry said:
Various people have asked on c.l.p about documentation of CPython's
virtual machine internals. The usual answers have been to see the dis
module doc for bytecodes and 'read the code' for more. Jakob Sievers
did so and posted his notes, with additions from Martin v. Löwis, as

http://wiki.python.org/moin/CPythonVmInternals

That's interesting. It's dumber than I thought. All temporaries
on the stack are "boxed" as PyObjects. That's simple and portable,
but slow.

John Nagle
 
M

Martin v. Löwis

That's interesting. It's dumber than I thought. All temporaries
on the stack are "boxed" as PyObjects. That's simple and portable,
but slow.

Not only that - Python does not ever have the concept of unboxed
values, except for local variables in the C implementations of
arithmetic operations and system calls.

Using true objects is slow only if allocation and deallocation is
slow, which it fortunately isn't.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top