Re: Why are intepreters so slow today

Stefan Esser (se@MI.Uni-Koeln.DE)
Mon, 18 Apr 1994 16:10:53 +0200

>>> My basic test is to run something equivalent to
>>>
>>> int i; double x = 0.0;
>>> for (i = 0; i < 1000000; i++) x = x + 1.0;
>>
>>I tried this on my machine, and also tried the equivalent code in
>>Smalltalk/V for Win32:
>>
>>x := 0.0.
>>1000000 timesRepeat: [x := x + 1.0]
>>
>>The C version, running in a DOS window under Windows 3.1, executed in
>>about 4 seconds. The Smalltalk code ran in 14 seconds. That's a factor
>>of between 1/3 and 1/4 the speed of the C version---Certainly within
>>your criterion of 1/10.

You can further improve on this:

Just use a machine that is even slower on
emulating floating point arithmetic. Then
the factor will approach 1 ...

When I compiled the C code on my Sparc, it took 0.076 seconds to run the C
version. I'd guess that more than 3.5 of the 4 seconds it took your PC were
spent in the FP emulation library. If you'd repeat the test on a 486DX2
with a good C compiler, you'd probably get a time of 0.2 seconds for the C
version and 5 to 10 seconds for the Smalltalk version.

That's a factor of 1/25 to 1/50, your value of 1/3 is only possible by
using a computer with slooow FP ...

STefan

-- 
 Stefan Esser				Internet:	<se@MI.Uni-Koeln.DE>
 Mathematisches Institut		Tel:		+49 221 4706010
 Universitaet zu Koeln			FAX:		+49 221 4705160
 Weyertal 80
 50931 Koeln