Better integer performance possible?

Dan Ingalls Dan.Ingalls at disney.com
Mon Oct 25 20:32:07 UTC 1999


Stephan Rudlof <stephan.rudlof at ipk.fhg.de> wrote...

>The integer performance of Squeak is poor compared with other Smalltalks,
>especially for big ints (~ factor 500) and not so much for small ones (~
>factor 3).
>
>What's the reason? Does anybody know if improvements are possible?

There are three reasons LargeInts are slower:

	It is all written in ST (no primitive support)
	The inner loops runs byte by byte
		[FYI, they were written when Squeak had 12-bit smallInts
		 -- can you guess out why?]
	Squeak does not have a JIT -- yet.

There is one reason SmallInts are slower:

	Squeak does not have a JIT -- yet.
		Also, in the factorial example, it may matter that
		Squeak allocates real objects for all contextx

Ask Ian about Jitter -- he has been having fun with it recently.  When he's done, I think the SmallInt comparison will be much better.  LargeInts will be similarly better, but not like the Dolphin numbers.  I personally have not ever found LargeInt speed to be a concern in any useful code.

We would happily invite a replacement LargeInt package into Squeak if it were at least as simple and understandable (I cannot imagine this not being the case!!), and if it did not add a significant overhead to the VM.

	- Dan

PS:  I know Squeak's bytecode speed got better on Windows in a recent VM, so 2.6 may be somewhat faster than 2.5.

>WinNT Dolphin Smalltalk Version 2.1 Patch Level 2:
>
>Time millisecondsToRun: [2000 factorial]. "big ints"
> 76 75 76
>Time millisecondsToRun: [1000 timesRepeat: [12 factorial]]. "small ints"
> 11 11 10
>
>WinNT Squeak 2.5:
>Time millisecondsToRun: [2000 factorial]. "big ints"
> 34520 34520 35080
>Time millisecondsToRun: [1000 timesRepeat: [12 factorial]]. "small ints"
> 30 30 30
>
>Stephan





More information about the Squeak-dev mailing list