Christian Spieler				Sunday, 29. March 1992
Technical University Darmstadt
Nuclear Physics Institute

To compile ZOO 2.10, a "large data model" (COMPACT or LARGE) has to be used.
The new high compression routines (imported from the AR compressor) use
to much dynamic data space to work in SMALL memory model.
Due to this change, the old assembler routines for the old 2.0 compressor/
extractor, as supplied in the original distribution, do no longer work.
These assembler routines were written for the small data model, they use near
data pointers.
I had to change the original Turbo C makefile, because it still tried to use
the assember routines in building the ZOO executable. After I moved the
".asm " suffix behind the ".c " suffix, i could reproduce the distributed
ZOO-executable.

Then I tried some optimization:
1.) Use of additional compiler optimization (Turbo C++ 1.0):
    The original makefile did not use any optimization flag for compilation.
    Some tests showed that this was already nearly optimum.
    I optained maximum optimization with "-a -d -G -O -Z", but I found that
    all these flags with the exception of "-d" (merge duplicate strings) were
    already use per default.
    The additional flag "-2" leads to a slightly smaller program, but this
    optimization is machine dependent (work only on 80286).
2.) The old ZOO 2.01 contained optimized file handling with unbuffered IO
    for large tranfers to use on some systems (including MSDOS).
    This code is not used in the distributed version of ZOO 2.10.
    I checked if it can be used. After reenableing UNBUF_IO in the modules
    zooadd.c and zooext.c I could compile a working program using UNBUF_IO.
    Benchmark tests showed a slightly better performance in handling the old
    compression method (both compression and extraction), but the high
    compression method was not affected, since their modules do not use the
    special IO routines that get enabled by the UNBUF_IO switch. In fact, I
    observed a very slight decrease in speed for the high compression. The only
    place were the UNBUF_IO routines are used is the handling of the file
    headers, but there the tranfered amount of data is smaller than io buffer
    size. Therefore unbuffered io is not used. The performance decrease is
    caused by the overhead of checking the transfer size.
    My conclusion was: UNBUF_IO is not worth using as long as it is not recog-
    nized by the high compression routines.
3.) Use of Assembler routines for compression/decompression:
    I modified the old assembler routines for the low compression/decompression
    to work with far data pointers. They can be used in Compact Model ZOO 2.10
    now. To verify that the supplied sources work in small model (with
    exception of high (de)compression), the special Turbo C++ inline assembler
    source for the crc function in module addbftcc.c has been modified to be
    model independent.
    Performance comparison between ZOO 2.10 using the modified assembler
    routines for the old fashioned compression with the supplied version using
    the generic C functions gave an interesting result:
    For compression, the assembler version gives a speed increase of more than
    a factor of 2.
    For decompression, the generic C version has a slight advantage over the
    assembler routine. This showes clearly the great improvements of the
    modified extraction algorithm introduced into lzd.c of ZOO 2.10.
    Since the assembler routines for decompression and compression were not
    independent, I modified lzc.asm not to use any procedure of lzd.asm and
    built an optimized program using the assembler module for compression and
    the C module for decompression.

To build the optimized MSDOS version of ZOO 2.10, use the makefile.tcc in the
MSDOS subdirectory and rename/remove LZD.ASM from the source directory.

List of all changed/modified sources:

addbftcc.c : modified inline assembler part to be model independant
	     (use near pointers in tiny, small and medium model)

io.c	   : changes from DECUS VAX91B tapes (see ZOO-210-VMSBUGS.DOC)

zooadd.c   : - reenabled possible use of UNBUF_IO switch
	     - merged two adjanced if-clauses using the same conditional,
	       saving a small amount of time and space.

zooadd2.c  : - corrected a typo in line 169:
	       changed "#ifdef PORTABLE" to "#ifndef PORTABLE".
	       The undocumented "-z" option to set the "z_fmt" flag to process
	       "Z-format archives" has to be included when PORTABLE is *NOT*
               set.

zooext.c   : - reenabled the possibility to use the UNBUF_IO switch

lzc.asm    : - added code so that module works together with C memory models
               compact, large and huge. This modification is controlled by
	       the switch "FAR_DATA_MODEL"
	     - when "STANDALONE" is defined, all references to items defined
	       in lzd.asm are removed. The call to addbfcrc() is implemented
	       directly.

lzd.asm    : - added code so that module works together with C memory models
               compact, large and huge. This modification is controlled by
	       the switch "FAR_DATA_MODEL"

vms.c      : changes from DECUS VAX91B tapes (see ZOO-210-VMSBUGS.DOC)

vmstime.c  : changes from DECUS VAX91B tapes
