Make your own free website on Tripod.com
Benchmark Program
By: Philip Sharp


This program runs 100 million integer instructions followed by 100 million floating point instructions. After the operations it checks the system time and then calculates the MIPS off the run time for the calculations.

The reason for testing integer and floating point instructions is in database and graphics applications, most of the delays in finishing the process is due to computational speed. If you are doing a database with over a million entrys, and many of those have multiple computations per entry, you want to use a computer that can do fast computations. Graphics applications also require a lot of math computations to be done to draw that various objects on the screen.


Benchmark Program Code
Written in C++


------------ Begin Code Block --------------
#include < ctime >
#include < cstdio >
#include < iostream >
#include < string >
#include < iomanip >

using namespace std;

void main()
{

	cout << "Starting Integer Divisions" << endl;
	for ( int i=1; i != 10000; i++ )
	{
		for ( int j=1; j != 10000; j++ )
		{
			int f = i/j;
		}
	}
	cout << "Done 100 Million Integer Divisions" << endl;
	float time1 = float(clock()) / CLOCKS_PER_SEC;
	cout << "Run time = " << time1 << "seconds" << endl;
	cout << "MIPS = " << 100000000 / (time1 * 1000000) << endl << endl;

	cout << "Starting Floating Point Divisions" << endl;
	for ( float k=1; k != 10000; k++ )
	{
		for ( float l=1; l != 10000; l++ )
		{
			float w = k/l;
		}
	}
	cout << "Done 100 Million Floating Point Divisions" << endl;
	float time2 = float(clock()) / CLOCKS_PER_SEC;
	cout << "Run time = " << time2-time1 << "seconds" << endl;
	cout << "MIPS = " << 100000000 / ((time2-time1) * 1000000) << endl;

	cout << "Type anything and < Enter > to exit" << endl;

	char foobar;
	cin >> foobar;
	exit(0);
}

--------------- End Code Block --------------

Benchmark Program Results
Processor  Integer Division Runtime | MIPS for Integer Division | FP Division Runtime | MIPS for FP Division
AMD 1800+	3.284s			    30.4507			1.212s			82.5003
P3 733MHz	6.098s			    16.3988		        4.837s			20.6740
500MHz Celeron	7.630s			    13.1062			6.540s			15.2905


This benchmark was run on three different types of hardware configurations. In each case the Integer Divisions took longer to complete than the Floating Point Divisions as expected. It also shows that as you increase in speeds the time the computations take to complete decreases almost linearly. Therefore based on only these results it would appear that the speed of the processor alone has the biggest affect on these computations so if you want to maximize the number of computations it is best to upgrade your processor to a faster speed.