[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking Speeds



To test the approximate speeds of several computers, I wrote the following 
code and ran it in QB:

Noio:
FOR i = 0 to 2042
FOR j = 0 to 2036
NEXT j
NEXT i

Withio:
FOR i = 0 to 2042
FOR j = 0 to 2036
a = INP(&H301)
b = INP(&H301)
c = INP(&H301)
d = INP(&H301)
NEXT j
NEXT i

The idea is to get a rough idea of what is limiting the speed of the 
various computers for the transfer of the memory contents to disk.  At 
least on the two AMD computers, the speed is not significantly different 
than the running Mark IV code.

One can compile Basic code.  As you can see below, it may or may not reduce 
the running time.  There are lots of things one can play with to optimize 
the running time of the compiled code.  It should always run faster as I 
compiled with the debug option off.  That is the run time system code has a 
test after each instruction is executed to look for a CNTRL BREAK while the 
compiled does not.  My experience with a large program is that you have to 
fuss with all the possible switches for optimum speed.  They do not always 
make sense.

No means the run time system.  Compiled means compiled with the break 
option off.  This is a free standing .exe file.  BRT means run with the 
Basic Run Time system.  This is a piece of code loaded with the .exe code 
that does most of the I/O operations.  This is useful if you have a lot of 
different QBasic programs since they can then be quite small since they all 
share the run time code.

The columns for the two programs are in seconds.

Computer	Compiled	Noio		Withio
600 Athelon  	No		5		59
		Yes		12		51
		BRT		12		51
500 K6	No		12		72
386		No		581		1078
		Yes		629		1574

Sorry, I don't know the actual speed of the 386.  No doubt 20 MHz or so.

OK, this means you need a fairly fast machine if you are going to run under 
QBasic.  Possibly Chris can run similar to the above on his machine to show 
what his code does.

I remember that I/O instructions really only take 3 microseconds or 
so.  With a modern computer, they can probably overlap other things like 
writes to the disk queue.  So the ultimate time is something like 48 
seconds.  I also recall that one can fuss with wait states to speed up the I/O

Tom Droege