[comp.sys.ibm.pc] Virtual 86 Slowdown

bradley.grigor@canremote.uucp (BRADLEY GRIGOR) (06/24/90)

dhinds@portia.Stanford.EDU (David Hinds) writes in reply to my
earlier posting re: slowdown in Virtual 8086 mode...

dD>    Hmmm... The slowdown doesn't seem to be very severe with Desqview
dD>running in virtual-86 mode.  Does Windows 3.0 add a lot of extra
dD>overhead? When I first installed Desqview-386, I tried running a
dD>bunch of benchmarks on an empty system (with no QEMM installed)
dD>versus running them in a DV window.  I don't remember the numbers,
dD>but there were no dramatic slowdowns using DV, even on video
dD>performance....

My only measured tests involve a small Turbo Pascal program,
listed below.  I just now ran a series of tests with this program
that demonstrate (to me at least) how bad Virtual 8086 mode can
be with interrupt intensive programs.

The tests show that DESQview runs the program about 33% slower
than real mode, when not doing direct screen writes.  Here are
all the results, measured in system clock ticks, averaged over
several runs for each case, with relative speed indexed to the
bare bones system:

          =========================================
                       DIRECT SCREEN   NOT DIRECT
                          WRITES      SCREEN WRITES
                       ticks  speed   ticks  speed
          -----------------------------------------
          Bare bones     90    1.00    210   1.00
          system
          -----------------------------------------
          QEMM-386       95    0.95    317   0.66
          active
          -----------------------------------------
          DESQVIEW       95    0.95    323   0.65
          under QEMM
          -----------------------------------------
          Windows 3.0    95    0.95    399   0.53
          =========================================

* Bare bones system:  No memory manager. Real mode.  Program run
  from DOS COMMAND prompt.
* QEMM-386 active:  QEMM-386 loaded and high RAM allocated with
  various things loaded high.  Virtual 8086 mode.  Program run
  from DOS COMMAND prompt.
* DESQview under QEMM:  QEMM-386 loaded and high RAM allocated with
  various things loaded high.  Virtual 8086 mode.  Program run
  from DOS COMMAND prompt in a "full screen" window (i.e. Big
  DOS).
* Windows 3.0:  HIMEM.SYS loaded as per Windows installation.
  Enhanced 386 mode (== Virtual 8086 mode).  Program run from DOS
  COMMAND prompt in a "maximized" window (i.e. DOS PROMPT from
  the Program Manager).
* DIRECT SCREEN WRITES:  Program compiled using "Crt" unit that
  bypasses standard I/O.  Very few DOS or BIOS interrupts.
* NOT DIRECT SCREEN WRITES: Program compiled without the "CRT"
  unit, outputting to standard output file.  Lots of DOS and
  BIOS interrupts.

----------------------------------cut here-----------------------------
program ScreenTest;

uses Crt;

var t0,t1: longint;
var Ticks: longint absolute $0040:$006C;
var k: integer;

procedure ClearScr;
var k: integer;
begin for k:=1 to 25 do writeln end;

procedure DumpLine(j: integer);
var k: integer;
begin for k:=1 to 80 do Write(Chr(Ord('A')+j)) end;

procedure DumpPage;
var k: integer;
begin for k:=1 to 24 do DumpLine(k) end;

begin
  ClearScr;
  t0:=Ticks;
  for k:=1 to 20 do DumpPage;
  t1:=Ticks;
  writeln(t1-t0,' clock ticks')
  end.
----------------------------------cut here-----------------------------

...bag     bradley.grigor@canremote.uucp      Newmarket, Ontario, Canada
---