3 ms·
Nice! How much of this optimization can be ported back to CPython, keeping compatibility but improving memory usage and speed?
by neil_s 12y ago
Nice! How much of this optimization can be ported back to CPython, keeping compatibility but improving memory usage and speed?
- carbon12 12y agoA lot of the internals are significantly different, and would be difficult to back port. Eg, a Micro Python object is a machine word which might be a pointer to a real object, a small integer, or an interned string. By stuffing small integers (and strings) into the unused bit-space of a machine word, Micro Python can do a lot of integer operations without allocating heap RAM. This is in contrast to CPython where all integers are on the heap (although the ones below 257 are cached). Another example: calling a function in CPython requires a heap allocation of the call frame. In Micro Python this is generally not needed (unless the function call is significantly complicated).
- est 12y agoThe problem is that CPython core developers does think performance is a priority. They think CPython is fast enough for everybody.
- keeperofdakeys 12y agoQuite simply, this project cut most of the features that big programs depend on, in order to make a smaller, faster core. Things like most of the standard library, meta-programming, and general scalability are included in these cuts. Most people don't realise how much python does underneath for them, which is why cpython is so "bloated" in comparison to this.