[net.micro.cbm] C128 CP/M benchmark/new vs. old BIOS

prindle@nadc@caip.RUTGERS.EDU (02/24/86)

From: prindle@NADC

Here are the results of running the "DHRYSTONE" benchmark on the C128 in CP/M
mode and compiled from the C source by Aztec C:

	Without register variables:	50 Dhrystones/second
	With register variables:	53 Dhrystones/second

For comparison sake, these figures are 19/33 for a C64 compiling with C-Power,
and 297/324 for an IBM-PC/XT running VENIX OS compiling with CC.

The absolute value of the benchmark result is not especially interesting, but
it serves as a baseline with which to observe the various overhead effects of
the new BIOS.  The above figure was obtained "flat out", i.e. running the old
BIOS and turning off the 40 column display (CONFIG 40COL=OFF).  With either the
new (Dec 85) or old (Aug 85) BIOS, running with the 40 column display enabled
slows down the Z80 processing by 6%.  This is because the VICII chip grabs and
holds the main RAM memory bus approximately 6% of the time in text mode (the
80 column chip holds it's bit-map in a completely separate dedicated 16K RAM,
and thus does not contribute significantly to slow-down).

The following table shows the drastic changes in throughput as 3 parameters are
changed in the new BIOS: 40COL, BAUD, and FEEL.  All comparisons are with
reference to the "flat out" benchmark result without register variables (50).

BAUD	FEEL	40COL	Dhrystones/sec.	LOSS(%)	COMMENTS
----	----	-----	---------------	-------	-------------------------------
50	9	off	     49.5	   1%	Impossible to run this way
						because keyboard not responsive
110	0	off	     46		   8%	Optimum for general use (i.e.
						if not using RS232 device)
110	0	on	     43		  14%	Optimum if 80col monitor not
						available.
300	2	off	     41		  18%	When you need to talk to RS232
						port at 300 baud.
300	2	on	     38		  24%	The way the new BIOS initially
						boots up (i.e. 24% slower!)
1200	2	off	     17		  66%   Talking to RS232 at 1200 baud.
						(or using IMP at 1200 baud)
1200	2	on	     14		  72%	If you must use 1200 baud *and*
						the 40 column screen!
1200	0	on	     11		  78%	As slow as it can go.  Unusable
						because keyboard too sensitive.

So, my conclusion from the above is that you should do a CONFIG BAUD=110,40COL=
OFF as soon as possible after booting up the new BIOS, preferrably in the
PROFILE.SUB file.  Using a slower baud rate makes the keyboard response too
sluggish.  BAUD=110 automatically sets feel to 0.  If you subsequently use the
IMP modem program, it will reset the BAUD rate as you internally select, and 
will leave BAUD set back to (beware) 300 when you exit IMP.

Based on the above info, I will be so bold as to say that timer interrupts are
left running continuously at the bit rate of the RS232 port (or faster), then
the keyboard scan is attempted every "n" interrupt cycles, where "n" is somehow
related to FEEL.  This is much less efficient than the C64 OS method where
the timer interrupts at the RS232 bit rate are generated *only* when an actual
RS232 byte (10 bits) is being transmitted or received, while keyboard scan is
handled via a separate slow (60hz.) timer interrupt.  In the C64 scheme, no
throughput penalty is experienced when not using the RS232 channel.  Hopefully
the new BIOS will eventually be upgraded to use the C64 scheme and the overall
Z80 throughput will not suffer so badly as a function of baud rate (remember
that the Dec 85 BIOS is only a beta-test version, not the final version to be
mailed out to registered CP/M users).

Frank Prindle
Prindle@NADC.arpa