In between SmallIntegers and LargeIntegers...FloatIntegers?

Bijan Parsia bparsia at email.unc.edu
Thu Apr 18 04:27:35 UTC 2002


A confluence of messages (some from comp.lang.lisp and some talk with Mark
Guzdial about numerics in general) leads me to make some speculative
queries.

It turns out that LispWorks (a Common Lisp implementation) uses a fair
number of tag bits with the result that it has relatively few
SmallIntegers. In a simple test someone made (iterate a large number of
times) they managed to get some *rather* slow results by having their
counter overflow into big integers, with the attendent memory
allocation/deallocation etc. See:

<http://groups.google.com/groups?hl=en&threadm=y6c7knz2kzl.fsf%40octagon.mrl.nyu.edu&rnum=2&prev=/groups%3Fhl%3Den%26scoring%3Dd%26q%3Dlispworks%2Bspeed%2Bissue%2Bgroup%253Acomp.lang.lisp.*>

One way around this was to chunk the loop, so the counter never exceeded
the maximum small integer, but this solution intrigued me:

<http://groups.google.com/groups?q=lispworks+speed+issue+group:comp.lang.lisp.*&hl=en&scoring=d&selm=3225031973116929%40naggum.net&rnum=3>

Summary: "An even simpler possibility is to use floating point operations
for semi-long integers."

It made me wonder want the impact of a scheme like that would be on
Squeak. I.e., would some loops benefit? How about all over memory
consumption? etc.

I plan to do some investigation of these issues, but I was wondering if
there were any folks with experience who could chime in or direct me to
the appropriate literature.

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list