// Emacs: -*- C++ -*-

static char rcsid[] = "$Id: timing-test.C,v 1.1 1992/08/20 22:27:56 rjj Exp $";

//
// $Log: timing-test.C,v $
// Revision 1.1  1992/08/20  22:27:56  rjj
// Initial revision
//

// 
// 
// Stupid timing test.  With default compilation ( -g (a.k.a. -max_code_size) and
// no -O (i.e., -do_what_programmer_would_do) I get the following times before
// my own loop unrolling:
//
//  % time ./timing-test averaged over ten cases
//  8.82u 0.34s 0:10.522 88.13% 0+83k 0.2+0.0 io  0.0 pf+0 w    before loop unrolling
//  7.73u 0.27s 0:09.019 89.62% 0+83k 0.3+1.3 io  0.8 pf+0 w    after loop unrolling
//
// more recent timings will show a better improvement in the optimized
// code, about 6% on raybans.cis.ufl.edu.  I expect the unoptimized version
// to show better than the above speedup, since the ``min'' and ``max'' 
// functions had the same kind of optimization applied.

#include <IntPoint.h>
#include <FloatPoint.h>

int main(int argc, char**argv)
{
    IntPoint	ip(0, 1, -2, -1), iq(3, 2, 1, 0);
    
    IA::exit_on_throw = 0;
    

    for (int i = 0; i < 100000; i++) {
	ip = min (ip, iq);
    }

}
