%% /u/sy/beebe/tex/bibsort/bibsort-0.15/README, Sat Jan 15 18:18:43 2000
%% Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
%% /u/sy/beebe/tex/bibsort/bibsort-0.13/README, Fri Sep 24 08:13:49 1999
%% Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
%% /u/sy/beebe/tex/bibsort/README, Thu Jun  9 13:16:28 1994
%% Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>

########################################################################
########################################################################
########################################################################
###                                                                  ###
### WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING  ###
###                                                                  ###
### There is a critical news item in the LATE-BREAKING NEWS section  ###
### below; do NOT install bibsort until you have read and understood ###
### the points noted there!                                          ###
###                                                                  ###
########################################################################
########################################################################
########################################################################

======
AUTHOR
======
	Nelson H. F. Beebe
	Center for Scientific Computing
	University of Utah
	Department of Mathematics, 322 INSCC
	155 S 1400 E RM 233
	Salt Lake City, UT 84112-0090
	USA
	Email: beebe@math.utah.edu, beebe@acm.org, beebe@ieee.org (Internet)
	WWW URL: http://www.math.utah.edu/~beebe
	Telephone: +1 801 581 5254
	FAX: +1 801 585 1640, +1 801 581 4148


============
INTRODUCTION
============

This directory contains bibsort, a UNIX tool for sorting BibTeX
bibliography files.

bibsort is freely distributable under the terms of the GNU General
Public License, a copy of which is provided in the file COPYING.


====================
INSTALLATION ON UNIX
====================

As with most GNUware, you can build, test, and install this program on
most UNIX, and other POSIX-compliant, systems by these simple steps:

In the USA:
	./configure && make all check install

Elsewhere:
	./configure && make all check install-ISO

These installations differ by just one significant character: the
first makes A-format the default paper, while the second makes ISO
A4-format the default.

If you wish to install it in a different file tree than the GNU
default of /usr/local, do so like this:

	./configure --prefix=/some/other/tree && make all check install

If you prefer, you can delay this choice until install time like this:

	make prefix=/some/other/tree install

No source code compilations are required, so the build, validation
test, and installation should only take a minute or so.

To reduce the directory to its pristine state of an original
distribution, do

	make distclean

It is IMPERATIVE that you do this between builds on different
architectures; otherwise, you will likely get incorrect versions of
Makefile variables chosen from the config.cache file created on an
earlier run.

This is what the "configure" output looks like on the author's Sun
Solaris 2.7 system:

% ./configure
creating cache ./config.cache
checking for mawk... /usr/local/bin/mawk
checking for autoconf... autoconf
checking for checksum... checksum
checking for chmod... chmod
checking for cmp... cmp
checking for col... col
checking for scp... scp -p
checking for rcp... (cached) scp -p
checking for cp... (cached) scp -p
checking for deroff... deroff
checking for diff... diff
checking for distill... distill
checking for dw... dw
checking for gzip... gzip
checking for ispell... ispell
checking for jar... jar
checking for ln... ln
checking for ls... ls
checking for man2html... man2html
checking for mkdir... mkdir
checking for nroff... nroff
checking for rm... rm
checking for sed... sed
checking for ksh... ksh
checking for shar... shar
checking for sleep... sleep
checking for sort... sort
checking for spell... spell
checking for tar... tar
checking for unzip... unzip
checking for zip... zip
checking for zoo... zoo
updating cache ./config.cache
creating ./config.status
creating Makefile
creating bibsort.sh

Here is what a run of the validation suite looks like on the author's
system:

% make check

========================================================================
Test of bibsort: there should be no output, other than the test and
command names. The tests take about 10 sec on a fast workstation.
============ check001: bibsort -?
============ check002: bibsort --author
============ check003: bibsort --copyright
============ check004: bibsort --help
============ check005: bibsort --version
============ check006: bibsort --byday
============ check007: bibsort --bypages
============ check008: bibsort --byseriesvolume
============ check009: bibsort --byvolume
============ check010: bibsort --byyear
============ check011: bibsort --byday --reverse
============ check012: bibsort --bypages --reverse
============ check013: bibsort --byseriesvolume --reverse
============ check014: bibsort --byvolume --reverse
============ check015: bibsort --byyear --reverse
============ check016: bibsort -\? -a -au -aut -auth -autho -author -c -co -cop -copy -copyr -copyri -copyrig -copyrigh -copyright -h -he -hel -help -v -ve -ver -vers -versi -versio --version --\? --a --au --aut --auth --autho --author --c --co --cop --copy --copyr --copyri --copyrig --copyrigh --copyright --h --he --hel --help --r --re --rev --reve --rever --revers --reverse --v --ve --ver --vers --versi --versio --version
============ check017: bibsort -byd -byda -byday -byl -byla -bylab -bylabe -bylabel -byp -bypa -bypag -bypage -bypages -bys -byse -byser -byseri -byserie -byseries -byseriesv -byseriesvo -byseriesvol -byseriesvolu -byseriesvolum -byseriesvolume -byv -byvo -byvol -byvolu -byvolum -byvolume -byy -byye -byyea -byyear -r -re -rev -reve -rever -revers -reverse
============ check018: bibsort -byday
============ check019: bibsort -bypages
============ check020: bibsort -byseriesvolume
============ check021: bibsort -byvolume
============ check022: bibsort -byyear
============ check023: bibsort -reverse -byday
============ check024: bibsort -reverse -bypages
============ check025: bibsort -reverse -byseriesvolume
============ check026: bibsort -reverse -byvolume
============ check027: bibsort -reverse -byyear
============ check028: bibsort -bylabel
============ check029: bibsort
============ check030: bibsort -bylabel -reverse
============ check031: bibsort -reverse
============ check032: bibsort --byday
============ check033: bibsort --byday --reverse
============ check034: bibsort --byseriesvolume
============ check035: bibsort --byseriesvolume --reverse
========================================================================


================================
LATE-BREAKING NEWS [15-Jan-2000]
================================

There is an apparent bug in the GNU sort program from the
GNU textutils-2.0 release at ftp://ftp.gnu.org/pub/gnu/textutils/

-rw-r--r-- 1 root root  957804  Jan 27 1997 00:00  textutils-1.22.tar.gz
-rw-r--r-- 1 root root 1532425  Aug  8 1999 01:05  textutils-2.0.tar.gz

Unfortunately, this bad version of sort is distributed as /bin/sort on
Redhat 6.1 GNU/Linux distributions, and likely others as well, so
there may already be millions of bad copies in the user community.
Redhat 6.0 had the 1.22 version, and is thus not affected.

If the bibsort validation suite tests fail because of bad sort order,
then you will need to install either a newer version of GNU textutils
that has fixed the problem (none was yet available as of 15 January
2000, though the sort bug had been reported to bug-textutils@gnu.org
by a local user on 21-Nov-1999), or else the older 1.22 version.  Once
you have done this, you can then do

	env SORT=/path/to/patched/sort ./configure && make all check

and if the validation tests then pass, you can complete the
installation with

	make install

Alternatively, you can supply the alternate version of sort directly
to make:

	make SORT=/path/to/patched/sort all check install

Since sort is the only member of textutils-2.00 where a bug affects
bibsort, you need not install all of the older text utilities; after a
successful build and validation, you could manually install just the
single executable, textutils-1.22/src/sort in /path/to/patched/sort.

In order to build textutils-1.22 on GNU/Linux Redhat 6.1 (both Intel and
SPARC) with gcc-2.95.2, I had to made one simple source patch to
eliminate a fatal compilation error from a strict compiler:

% diff -c src/tr.c.~1~ src/tr.c
*** src/tr.c.~1~        Fri Dec 13 16:41:21 1996
--- src/tr.c    Sat Jan 15 18:13:49 2000
***************
*** 231,237 ****
--- 231,239 ----
  
  
  char *xmalloc ();
+ #if 0
  char *stpcpy ();
+ #endif
  int safe_read ();
  
  /* The name by which this program was run.  */


==========================
INTERNET ARCHIVE LOCATIONS
==========================

The master copy of bibsort can be found on the Internet archive
at

	ftp://ftp.math.utah.edu/pub/misc/bibsort-0.15.jar
	ftp://ftp.math.utah.edu/pub/misc/bibsort-0.15.tar.gz
	ftp://ftp.math.utah.edu/pub/misc/bibsort-0.15.zip
	ftp://ftp.math.utah.edu/pub/misc/bibsort-0.15.zoo

	http://www.math.utah.edu/pub/misc/bibsort-0.15.jar
	http://www.math.utah.edu/pub/misc/bibsort-0.15.tar.gz
	http://www.math.utah.edu/pub/misc/bibsort-0.15.zip
	http://www.math.utah.edu/pub/misc/bibsort-0.15.zoo

It may be automatically mirrored from there to other Internet sites.

Pick the distribution archive format that is most convenient for you.


=====================
DISTRIBUTION CONTENTS
=====================

The files in the bibsort distribution consist of:

CHANGELOG		Reverse time-ordered log of changes to bibsort.

COPYING			GNU General Public License.

Makefile.in		UNIX Makefile template for testing, installing
			and uninstalling bibsort.

README          	This file

README.AWK		Notes on awk implementations, availability,
			and documentation.

bibsort.hlp     	ASCII text file with formatted manual pages in
                	VAX VMS HELP format

bibsort.html		HTML version of bibsort.man.

bibsort.man     	manual pages (nroff/troff input)


bibsort.pdf		Adobe Portable Document Format typeset output
			from bibsort.man.

bibsort.ps		PostScript version of typeset manual pages

bibsort.sin		GNU autoconfigure template for generating
			bibsort.sh and the installed bibsort script.

bibsort.sok		Spelling exception dictionary for bibsort
			documentation.

bibsort.txt		ASCII text file with formatted manual pages

configure		GNU autoconfigure script.

configure.in		GNU autoconfigure template for generating
			configure script.

man2ps          	UNIX shell script for directing conversion of
			nroff/troff files to PostScript

mkdir.sh		UNIX shell script for simulating "mkdir -p",
			which is not universally available.

rofvms.awk      	AWK script to convert .txt file to .hlp file

save/configure		Backup copy of UNIX configure script generated
			from configure.in by GNU autoconf.

save/Makefile		Backup copy of UNIX Makefile generated from
			Makefile.in by configure.

test/*.in		Test input files for "make check".

test/*.opt		Test option files for "make check".

test/okay/*.out		Correct bibsort output on stdout for "make check".

test/okay/*.err		Correct bibsort output on stderr for "make check".


========
PROBLEMS
========

On HP-9000/735 systems running HP-UX 9.0.1, I had been using nawk via
a symbolic link to /usr/bin/awk.  Unfortunately, when I added the
additional regular-expression patterns [ \t]* to the awk program in
bibsort.sh, this failed: the HP awk complained:

nawk: duplication operator in illegal position

 source line number 9
 context is
        /^[ \t]*@[ \t]*[Pp][Rr][Ee][Aa][Mm][Bb][Ll][Ee][  >>>   ]*{/ <<<  {

This is either a bug in the HP regular expression library, or a
limitation of an older version of HP awk.

I next attempted switching to GNU gawk version 2.15 on this system,
but that failed too.  I finally replaced the /usr/local/bin/nawk
symbolic link to /usr/bin/awk with a compiled version from nawk source
code licensed from AT&T, with files dated December 1991 and December
1987, clearly an ancient version, but it did the trick.

If you need to run bibsort on HP-UX 9.x.x, you probably won't be able
to readily repeat what I did, unless you order nawk sources from AT&T
(about US$100 when I did so), so I suggest installing a modified copy
of bibsort.sh as bibsort, with the patterns [ \t]* eliminated from all
but the initial position in the awk program.  If your bibliography
files have been prettyprinted by bibclean, there will be no whitespace
in the positions matched by those patterns, so the change should not
prove to be a serious limitation.


=================
EFFICIENCY ISSUES
=================

I was unhappy with the runtime performance of bibsort on older
systems, but the availability of fast new systems, and limited
development time, made me put aside the problem until the preparation
of version 0.13 in September 1999, when I finally made a major
improvement.

With a program that depends on another program in a scripting
language, and also on other UNIX commands in a shell pipeline, it is
not immediately evident where the time is being spent.

Fortunately, several years ago, I had prepared a modification of AT&T
awk, called pawk, for profiling awk programs.

I therefore made a copy of the bibsort.sh script and modified it split
the pipeline into separately timeable steps, and used pawk instead of
the old default gawk.

Using a large test bibliography file, available at

        ftp://ftp.math.utah.edu/pub/tex/bib/ieeesoft.bib

the step timings showed that 99% of the time used by bibsort was in
the awk program, and that in that program, a single function,
brace_count(), accounted for 86% of the run time.

I therefore made a test directory with six different candidate
implementations of that function, and ran tests on multiple
architectures with those six tests, and each available awk
implementation.  To further eliminate questions of the effect of
compiler optimization level, on two systems, I built versions of gawk
and mawk with a range of compiler optimization levels.

The results shown in the report below were produced automatically by a
modest awk program from the typescripts of the test runs.  They show
surprising differences in the speed of both the awk implementations,
and the brace_count() function candidates (bc-1 is the algorithm used
in bibsort 0.12 and earlier).  The conclusions from this table are
significant:

        (1) changing the awk implementation can produce as much as a
            factor of 8.4 in the speed of brace_count(), which will likely
            mean as much as a factor of 7 for bibsort;

        (2) changing to algorithm bc-2 can produce as much as a factor
            of 25.6 over the original bc-1 algorithm.

Combined, on most systems, these two simple changes should produce a
speedup of one to two orders of magnitude, which is most gratifying;
see the end of this section for the final story.

For each tested machine in the report below, there are two tables.

(1) The first, labeled ``Algorithm Relative Time'' should be read
    rowwise: 1.00 is the fastest algorithm, and larger numbers are
    that much slower.

(2) The second, labeled ``Implementation Relative Time'' should be
    read columnwise; 1.00 is the fastest awk implementation for the
    algorithm of that column, and larger numbers are that much slower.

All of the major workstation vendors are covered by these tests, and
on some, there is a range of models and operating system versions.

========================================================================

alab07.math.utah.edu            DEC Alpha 3000/300LX;          OSF/1 3.0
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.72    1.00   67.76  171.76     n/a   10.41
nawk              12.43    1.00   67.59  170.77     n/a   10.33
gawk              16.39    1.00   21.65   22.60     n/a    4.48
mawk              13.97    1.00   12.17   11.87     n/a    6.28

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                2.19    2.61   14.56   37.82     n/a    4.34
nawk               2.33    2.62   14.57   37.73     n/a    4.32
gawk               6.46    5.51    9.80   10.48     n/a    3.93
mawk               1.00    1.00    1.00    1.00     n/a    1.00


mosso.math.utah.edu             DEC Alpha 4100-5/266;          OSF/1 4.0F
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.67    1.00   35.34   24.03     n/a    1.59
nawk              11.68    1.00   36.10   24.41     n/a    1.59
gawk              15.85    1.00   19.93   20.91     n/a    6.14
mawk              16.89    1.00   16.30   15.33     n/a    6.74

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                2.05    2.96    6.43    4.64     n/a    1.01
nawk               2.02    2.93    6.48    4.66     n/a    1.00
gawk               4.48    4.78    5.84    6.51     n/a    6.29
mawk               1.00    1.00    1.00    1.00     n/a    1.44


piute.math.utah.edu             HP 9000/715-64;                HP-UX 10.01
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               13.59    1.00   22.41   22.64     n/a    1.48
nawk              14.39    1.00   24.09   25.10     n/a    1.57
gawk              20.09    1.00   24.89   26.07     n/a    8.02
mawk              19.98    1.00   16.56   15.50     n/a    7.75

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                3.76    5.53    7.49    8.08     n/a    1.06
nawk               3.65    5.07    7.37    8.21     n/a    1.03
gawk               5.36    5.33    8.01    8.96     n/a    5.51
mawk               1.00    1.00    1.00    1.00     n/a    1.00


eve.math.utah.edu               HP 9000/735;                   HP-UX 10.01
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               15.25    1.00   29.39   25.09     n/a    1.66
nawk              13.95    1.00   25.19   23.80     n/a    1.55
gawk              16.88    1.00   25.60   23.23     n/a    7.64
mawk              19.26    1.00   16.44   15.76     n/a    8.13

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                3.74    4.72    8.44    7.52     n/a    1.00
nawk               3.72    5.13    7.86    7.75     n/a    1.01
gawk               5.02    5.72    8.91    8.44     n/a    5.58
mawk               1.00    1.00    1.00    1.00     n/a    1.04


bottom.physics.utah.edu         IBM PowerPC 43P;               AIX 4.2
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               10.59    1.00   25.63   26.04     n/a    1.63
nawk              10.69    1.00   25.64   25.80     n/a    1.65
gawk-O1             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O2             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O3             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O4             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O5             n/a     n/a     n/a     n/a     n/a     n/a
gawk              16.11    1.00   19.98   21.44     n/a    7.00
mawk-g            19.80    1.00   15.92   16.18     n/a    6.24
mawk-O1             n/a     n/a     n/a     n/a     n/a     n/a
mawk-O2           17.35    1.00   14.57   14.40     n/a    6.65
mawk-O3           17.04    1.00   14.28   13.75     n/a    6.79
mawk-O4             n/a     n/a     n/a     n/a     n/a     n/a
mawk-O5             n/a     n/a     n/a     n/a     n/a     n/a
mawk              16.10    1.00   13.82   13.28     n/a    6.28

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                3.18    5.09    9.13    9.63     n/a    1.25
nawk               3.19    5.05    9.07    9.48     n/a    1.26
gawk-O1             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O2             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O3             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O4             n/a     n/a     n/a     n/a     n/a     n/a
gawk-O5             n/a     n/a     n/a     n/a     n/a     n/a
gawk               5.62    5.91    8.27    9.22     n/a    6.26
mawk-g             2.52    2.16    2.41    2.54     n/a    2.03
mawk-O1             n/a     n/a     n/a     n/a     n/a     n/a
mawk-O2            1.13    1.11    1.13    1.16     n/a    1.11
mawk-O3            1.01    1.00    1.00    1.00     n/a    1.03
mawk-O4             n/a     n/a     n/a     n/a     n/a     n/a
mawk-O5             n/a     n/a     n/a     n/a     n/a     n/a
mawk               1.00    1.05    1.02    1.02     n/a    1.00


oquirrh.math.utah.edu           Intel Pentium II MMX (300MHz); GNU/Linux 2.0.35
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                9.32    1.00   31.98   33.34     n/a    1.47
nawk               9.21    1.00   31.60   33.02     n/a    1.46
gawk              22.63    1.00   25.34   26.32     n/a    5.58
mawk              21.86    1.00   18.00   16.11     n/a    6.36

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.61    3.79    6.73    7.84     n/a    1.00
nawk               1.61    3.82    6.71    7.83     n/a    1.00
gawk               5.36    5.18    7.29    8.46     n/a    5.19
mawk               1.00    1.00    1.00    1.00     n/a    1.14


jabberwocky.math.utah.edu       NeXT Turbostation;             Mach 3.3
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               14.24    1.00   29.20   29.11     n/a    1.30
nawk              14.15    1.00   29.02   29.00     n/a    1.29
gawk              17.38    1.00   20.73   21.14     n/a    7.02
mawk              17.97    1.00   17.83   16.04     n/a    7.16

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                4.65    5.86    9.60   10.65     n/a    1.06
nawk               4.64    5.89    9.59   10.66     n/a    1.06
gawk               6.23    6.44    7.48    8.48     n/a    6.31
mawk               1.00    1.00    1.00    1.00     n/a    1.00


cortex.math.utah.edu            SGI Indigo-2;                  IRIX 5.3
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.28    1.00   18.91   19.91     n/a    1.79
nawk              11.20    1.00   19.51   19.90     n/a    1.78
gawk              17.62    1.00   25.17   24.04     n/a    7.04
mawk              17.84    1.00   14.35   13.83     n/a   10.04

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                2.19    3.47    4.57    5.00     n/a    1.01
nawk               2.18    3.47    4.72    4.99     n/a    1.00
gawk               3.86    3.91    6.85    6.79     n/a    4.44
mawk               1.00    1.00    1.00    1.00     n/a    1.62


rumplemeyer.math.utah.edu       SGI Indy PC/24;                IRIX 5.3
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                8.97    1.00   21.14   22.12     n/a    1.61
nawk               8.92    1.00   21.06   22.05     n/a    1.60
gawk              23.21    1.00   29.57   28.98     n/a    5.32
mawk              19.03    1.00   17.11   16.11     n/a    6.47

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.80    3.82    4.72    5.24     n/a    1.00
nawk               1.80    3.83    4.72    5.24     n/a    1.00
gawk               5.80    4.75    8.21    8.54     n/a    4.13
mawk               1.00    1.00    1.00    1.00     n/a    1.06


golan.math.utah.edu             SGI O2 R10000-SC;              IRIX 6.3
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               12.83    1.00   22.78   23.53     n/a    1.82
nawk              12.78    1.00   22.62   23.30     n/a    1.80
gawk              17.74    1.00   27.44   23.47     n/a    9.42
mawk              20.74    1.00   16.44   15.92     n/a    6.77

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.57    2.53    3.51    3.74     n/a    1.01
nawk               1.57    2.55    3.51    3.73     n/a    1.00
gawk               3.38    3.95    6.60    5.83     n/a    8.13
mawk               1.00    1.00    1.00    1.00     n/a    1.48


ceslab09.math.utah.edu          SGI O2 R5000-??;               IRIX 6.2
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.79    1.00   22.02   23.17     n/a    1.80
nawk              11.93    1.00   22.40   23.61     n/a    1.81
gawk              17.01    1.00   21.15   22.61     n/a   11.02
mawk              17.67    1.00   15.44   15.05     n/a    6.98

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.98    2.97    4.24    4.57     n/a    1.01
nawk               1.98    2.92    4.24    4.59     n/a    1.00
gawk               4.64    4.82    6.60    7.24     n/a   10.04
mawk               1.00    1.00    1.00    1.00     n/a    1.32


philo.math.utah.edu             SGI O2 R5000-PC;               IRIX 6.5
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               10.94    1.00   24.44   25.93     n/a    1.80
nawk              10.79    1.00   24.23   25.69     n/a    1.78
gawk              21.33    1.00   17.69   19.56     n/a    9.77
mawk              21.91    1.00   15.08   14.30     n/a    7.49

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.59    3.18    5.15    5.76     n/a    1.00
nawk               1.58    3.20    5.15    5.76     n/a    1.00
gawk               5.91    6.07    7.12    8.30     n/a   10.39
mawk               1.00    1.00    1.00    1.00     n/a    1.31


eilat.math.utah.edu             SGI Origin/200-4;              IRIX 6.4
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               13.35    1.00   22.90   23.84     n/a    1.90
nawk              13.22    1.00   22.56   23.67     n/a    1.90
gawk              18.52    1.00   22.42   22.85     n/a    9.50
mawk              20.58    1.00   15.96   15.40     n/a    6.55

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                1.53    2.36    3.38    3.65     n/a    1.00
nawk               1.53    2.38    3.36    3.66     n/a    1.00
gawk               3.40    3.77    5.30    5.60     n/a    7.98
mawk               1.00    1.00    1.00    1.00     n/a    1.46


sunev.math.utah.edu             Sun SPARC 10/412;              GNU/Linux 2.0.35
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               12.28    1.00   31.54   29.91     n/a    1.43
nawk              12.26    1.00   31.53   29.91     n/a    1.44
gawk-O1           20.86    1.00   24.49   25.31     n/a    4.46
gawk-O2           21.21    1.00   24.78   25.63     n/a    4.34
gawk-O3           20.74    1.00   25.08   25.97     n/a    4.35
gawk-O4           20.73    1.00   25.07   25.95     n/a    4.34
gawk-O5           20.73    1.00   25.07   25.95     n/a    4.34
gawk              21.19    1.00   24.74   25.52     n/a    4.33
mawk-O1           17.79    1.00   15.73   15.17     n/a   11.94
mawk-O2           17.96    1.00   15.80   15.25     n/a   12.06
mawk-O3           17.87    1.00   15.78   15.24     n/a   12.28
mawk-O4           17.75    1.00   15.70   15.16     n/a   12.20
mawk-O5           17.97    1.00   15.86   15.32     n/a   12.32
mawk              17.87    1.00   15.81   15.25     n/a   11.99

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                3.63    5.30   10.55   10.36     n/a    1.00
nawk               3.62    5.30   10.55   10.36     n/a    1.00
gawk-O1            9.86    8.48   13.09   14.01     n/a    4.98
gawk-O2            9.93    8.40   13.13   14.06     n/a    4.80
gawk-O3            9.84    8.51   13.46   14.43     n/a    4.87
gawk-O4            9.84    8.52   13.46   14.43     n/a    4.87
gawk-O5            9.84    8.52   13.46   14.43     n/a    4.87
gawk               9.93    8.41   13.12   14.01     n/a    4.80
mawk-O1            1.02    1.03    1.02    1.02     n/a    1.62
mawk-O2            1.01    1.01    1.01    1.01     n/a    1.61
mawk-O3            1.00    1.01    1.00    1.00     n/a    1.63
mawk-O4            1.00    1.01    1.00    1.00     n/a    1.62
mawk-O5            1.00    1.00    1.00    1.00     n/a    1.62
mawk               1.02    1.02    1.02    1.02     n/a    1.61


quadra.math.utah.edu            Sun SPARC 2;                   Solaris 2.5
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.78    1.00   54.10   46.78     n/a    1.49
nawk              11.59    1.00   52.60   43.13     n/a    1.38
gawk              19.98    1.00   24.91   24.85     n/a    5.65
mawk              13.93    1.00   12.58   11.61     n/a   10.28

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                3.77    4.46   19.17   17.96     n/a    1.03
nawk               3.87    4.65   19.45   17.27     n/a    1.00
gawk               8.66    6.04   11.95   12.92     n/a    5.32
mawk               1.00    1.00    1.00    1.00     n/a    1.60


mosquera.math.utah.edu          Sun Ultra 5;                   Solaris 2.6
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                9.35    1.00   28.76   28.85     n/a    1.19
nawk               9.37    1.00   27.91   28.09     n/a    1.21
gawk              25.66    1.00   25.95   26.31     n/a    6.21
mawk              16.43    1.00   14.76   13.89     n/a    7.11

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                2.95    5.19   10.11   10.78     n/a    1.00
nawk               2.93    5.14    9.71   10.38     n/a    1.00
gawk               7.30    4.68    8.22    8.86     n/a    4.69
mawk               1.00    1.00    1.00    1.00     n/a    1.15


suncore.math.utah.edu           Sun Ultra Enterprise 5500;     Solaris 2.6
                Algorithm Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk               11.31    1.00   31.55   31.33     n/a    1.44
nawk              11.70    1.00   33.00   32.70     n/a    1.51
gawk              19.54    1.00   23.49   24.27     n/a    6.76
mawk              16.20    1.00   13.68   12.76     n/a    6.84

                Implementation Relative Time (User + System)
                   bc-1    bc-2    bc-3    bc-4    bc-5    bc-6
awk                2.62    3.76    8.67    9.23     n/a    1.00
nawk               2.60    3.60    8.68    9.23     n/a    1.01
gawk               4.68    3.88    6.66    7.38     n/a    4.86
mawk               1.00    1.00    1.00    1.00     n/a    1.27

========================================================================

Once the new version (bibsort-0.13) was installed everywhere (using
mawk, which the above table found uniformly the fastest for the
brace_count() function), I went back and made up a second test to
compare the speed of the last two versions on the same test file as
before.

Once again, a modest awk program produced the table below completely
automatically from the test typescripts.  In summary, speedups in
elapsed wall clock time ranged from 8.71 to 20.59, and in CPU (user +
system) time from 1.00 to 30.58.

Even more gratifying is that the greatest wall clock time speedups
were seen on the oldest (and slowest) systems!

========================================================================

alab07.math.utah.edu            DEC Alpha 3000/300LX;          OSF/1 3.0
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.04           26.60
bibsort-0.13               1.00            1.00


mosso.math.utah.edu             DEC Alpha 4100-5/266;          OSF/1 4.0F
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           18.29
bibsort-0.13               1.17            1.00


piute.math.utah.edu             HP 9000/715-64;                HP-UX 10.01
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              20.61           19.32
bibsort-0.13               1.00            1.00


eve.math.utah.edu               HP 9000/735;                   HP-UX 10.01
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              20.98           27.65
bibsort-0.13               1.00            1.00


bottom.physics.utah.edu         IBM PowerPC 43P;               AIX 4.2
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               9.67            8.71
bibsort-0.13               1.00            1.00


oquirrh.math.utah.edu           Intel Pentium II MMX (300MHz); GNU/Linux 2.0.35
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              20.90           21.02
bibsort-0.13               1.00            1.00


jabberwocky.math.utah.edu       NeXT Turbostation;             Mach 3.3
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           18.04
bibsort-0.13              20.85            1.00


cortex.math.utah.edu            SGI Indigo-2;                  IRIX 5.3
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           11.72
bibsort-0.13              20.41            1.00


rumplemeyer.math.utah.edu       SGI Indy PC/24;                IRIX 5.3
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           17.99
bibsort-0.13              20.83            1.00


golan.math.utah.edu             SGI O2 R10000-SC;              IRIX 6.3
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           12.92
bibsort-0.13              21.88            1.00


ceslab09.math.utah.edu          SGI O2 R5000-??;               IRIX 6.2
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12               1.00           13.09
bibsort-0.13              21.30            1.00


philo.math.utah.edu             SGI O2 R5000-PC;               IRIX 6.5
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              18.43           17.78
bibsort-0.13               1.00            1.00


eilat.math.utah.edu             SGI Origin/200-4;              IRIX 6.4
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              14.08           16.45
bibsort-0.13               1.00            1.00


sunev.math.utah.edu             Sun SPARC 10/412;              GNU/Linux 2.0.35
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              30.59           30.58
bibsort-0.13               1.00            1.00


nicksun.math.utah.edu           Sun SPARC LX;                  Solaris 2.5
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              27.41           28.85
bibsort-0.13               1.00            1.00


quadra.math.utah.edu            Sun SPARC 2;                   Solaris 2.5
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              27.49           24.65
bibsort-0.13               1.00            1.00


mosquera.math.utah.edu          Sun Ultra 5;                   Solaris 2.6
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              16.59           16.38
bibsort-0.13               1.00            1.00


suncore.math.utah.edu           Sun Ultra Enterprise 5500;     Solaris 2.6
                                Relative Time
                        (User + System)  (Wall Clock)
bibsort-0.12              14.92           16.69
bibsort-0.13               1.00            1.00
========================================================================
