a Twitter thread from @anthonypjshaw

a Twitter thread from @anthonypjshaw

@TwitterVid_bot

1.

Getting up to speed with the Python 3.12 ideas from the Faster CPython team. One that’s been thrown around is a CPU register allocator in the eval loop. Currently, Python opcodes use a “stack” to store and load objects between instructions 1/

2.

The proposal is to instead push and pop values onto CPU registers. Aarch64 (ARM64) chips have 31 general purpose registers. Stacks are normally pretty small (<10) so this could bring a nice efficiency improvement to both Intel and ARM CPUs 2/

3.

This is how most compiled languages deal with local variables. They work out whether certain CPU registers can be used to store their values because that’s faster than RAM. When registers are full/allocated, they put variables in memory. //

4.

This idea was proposed in a paper by some researchers who also implemented this. Trying to track down the paper

5.

Here’s the paper https://dl.acm.org/doi/pdf/10.1145/3568973


Read this thread on Twitter


Made by @TwitterVid_bot

Report Page