[Python-Dev] Tagged integers

Brian Quinlan brian at sweetapp.com
Wed Jul 14 11:40:40 CEST 2004


James Y Knight wrote:
> So I was saying to someone the other day "Gee, I wonder why Python 
> doesn't use tagged integers, it seems like it would be a lot faster than 
> allocating new objects all the time.", and they said "Cause you'd have 
> to change everything, too much work!" and I said "Nah, you only need to 
> change a few things to use macros, it'd only take a few hours, mostly 
> query-replace".
> 
> So, of course, I had to do it then, and it only took a couple hours, and 
> appears to be at least somewhat faster.

It made integer-heavy things 20% faster. How much slower did it make 
everything else? Did you try running a complete benchmark (e.g. 
pystone) before and after?

And the lack of portability is a real problem - it means that every 
code path must be tested twice AND there might be architectures and 
problems were tagged integers work but it actually makes things slower.

I'm skeptical until I see a complete system benchmark but it's great 
that you tried this!

Cheers,
Brian


More information about the Python-Dev mailing list