Re: speed with python

Sjoerd Mullender (Sjoerd.Mullender@cwi.nl)
Thu, 06 Jan 1994 21:41:17 +0100

On Thu, Jan 6 1994 Guido.van.Rossum@cwi.nl wrote:

> In 1.0.0, there are some new optimizations (e.g. small integers and
> short strings are cached), but it remains to be seen how this affects
> performance -- in all honestly, I've been too busy getting
> functionality right and bugs out that I haven't really checked raw
> performance... Why don't you fetch 1.0.0 beta 5 and test it out?
> You may also try to measaure the effect of various optimization
> parameters. Check out the #if statements in intobject.c,
> stringobject.c, tupleobject.c and mappingobject.c. (Anything else I've
> forgotten, Sjoerd?)

No, you didn't forget any.

The defines are NSMALLPOSINTS, NSMALLNEGINTS in intobject.c;
DONT_SHARE_SHORT_STRINGS in stringobject.c; MAXSAVESIZE in
tupleobject.c; and CACHE_HASH in stringobject.c and mappingobject.c.
If you switch between defining and not defining CACHE_HASH, you'll
need to recompile everything.

The idea behind the first four defines is to reduce the number of
times malloc is called. The last define is to reduce the number of
times a hash value for a string is calculated.

Sjoerd Mullender
CWI, dept. CST, Kruislaan 413, 1098 SJ Amsterdam, Netherlands
email: Sjoerd.Mullender@cwi.nl fax: +31 20 592 4199
phone: +31 20 592 4127 telex: 12571 mactr nl