Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!kth.se!sunic!mcsun!hp4nl!media03!pkr From: pkr@media03.UUCP (Peter Kriens) Newsgroups: comp.lang.smalltalk Subject: Re: Integer / Float arithmetic in ST80 Keywords: number classes, speed of floats, primitives Message-ID: <2322@media03.UUCP> Date: 21 May 91 08:00:26 GMT References: Reply-To: pkr@media03.UUCP (Peter Kriens) Organization: aQute, Netherlands Lines: 15 hm279he@uni-duisburg.de (Heckes) writes: My question is: Is it possible to make the Float messages perform as fast as the SmallInteger ones? I don't think that you can make the floats as fasts as Integers, even if you would have zero calculate time. The point is, is that SmallIntegers are a very special breed of objects. In most Smalltalks, the object pointer domain is divided in two ranges. A bit in this pointer specifies if it is a pointer or an Integer. This means that there is no garbage collection on instances of the class integer. The pointer is the instance. Because a float uses from 4 to 10 bytes of memory, you will create a lot of very small objects, and they need to be created and garbage collected, so that is where your time goes. Peter Kriens