[Python-Dev] Tagged integers

Christian Tismer tismer at stackless.com
Thu Jul 15 12:04:18 CEST 2004


Brian Quinlan wrote:

...

> 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 think it was not the proposal to use tagging on
every platform, but just those where it works.
Having this as a compile time feature would make it
possible to optimize your Python for your purposes.

Things get interesting when it comes to compare
refcounting cost vs. pointer decoding cost
vs. garbage collection cost.

I have no idea what the results will be, and I think
it is just *great* to try this out, because the effect
could be dramatic:

If very many tiny, often-used objects are tagged, then
very many refcount actions can be saved, and the overall
object count shrinks, Boehm GC might become feasible.
If we then can write C extensions without having to think
of reference counts, code would be simplified quite
much, and I would save 80 percent of debugging time.

Maybe we have a set of rules which depend on each other:

1) "Tagging is -1000 because of the headaches"

2) "Everything is object and has refcount"

3) "Many tiny objects must be allocated as blocks"

4) "Boehm GC disables bulk allocation of tiny objects"

1) is just a claim which I would not sign, see the post about
systematically renaming fields to find all places with
the compiler.

1) leads to 2), 2) leads to 3), and this disables using 4).
By solving 1), it might be possible to break the whole chain,
and I would even accept a slitghly slower result, if
the whole system gets *simpler* by dropping refcounts.

So whatever is the outcome, I'm happy that somebody
took it on to try this out.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  mobile +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/



More information about the Python-Dev mailing list