Chris Lattner
๐ค SpeakerAppearances Over Time
Podcast Appearances
And so they do the very logical thing of keeping the memory representation of all objects the same.
So all objects have a header.
They have payload data.
And what this means is that every time you pass around an object, you're passing around a pointer to the data.
Well, this has overhead.
It turns out that modern computers don't like chasing pointers very much and things like this.
It means that you have to allocate the data.
It means you have to reference count it, which is another way that Python uses to keep track of memory.
And so this has a lot of overhead.
And so if you say, okay, let's try to get that out of the heap, out of a box, out of an indirection, and into the registers.
Mm-hmm.
That's another 10x.
Yep.
And if you look at, you know, people complain about the Python GIL.
This is one of the things that hurts parallelism.
That's because of the reference counting.
Right.
And so the GIL and reference counting are very tightly intertwined in Python.
It's not the only thing, but it's very tightly intertwined.
And so then you lean into this and you say, okay, cool.