java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----GWin
|
+----Project
|
+----TestMatrix
This code is (c) 1997 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
This was tested with Symantec Cafe 1.51 with JIT 3.0 beta 3, with both pure Java, and with the Matrix.dll (compiled by Microsoft Visual C++ Developer Studio, 1995 version). The test was run under WinNT on a 200 MHz Pentium Pro.
The last four numbers on each row are # seconds to run on:
200 MHz 100MB Pentium Pro with DLL
200 MHz 100MB Pentium Pro without DLL
166 MHz 16MB Pentium with DLL
166 MHz 16MB Pentium without DLL
MatrixF is the WebSim Matrix object modified to use floats instead of doubles,
and the DLL was also modified to use floats instead of doubles. Floats appear
to be only very slightly faster than doubles, even for these extremely
floating-point-intensive benchmarks.
MatrixF: exp=0, iter=5000, size= 30 3.484 17.735 6.21 26.59
Matrix: exp=0, iter=5000, size= 30 3.906 18.062 7.41 28.28
MatrixF: exp=1, iter=5000, size= 30 3.453 17.735 6.26 27.74
Matrix: exp=1, iter=5000, size= 30 3.89 18.047 7.42 28.28
MatrixF: exp=2, iter=5000, size= 30 3.344 17.39 5.99 26.86
Matrix: exp=2, iter=5000, size= 30 3.719 17.625 6.97 28.18
MatrixF: exp=3, iter= 200, size= 30 0.125 0.672 0.27 1.04
Matrix: exp=3, iter= 200, size= 30 0.14 0.688 0.28 1.1
MatrixF: exp=0, iter= 4, size=300 5.985 18.141 17.03 33.67
Matrix: exp=0, iter= 4, size=300 10.203 21.938 27.63 42.46
MatrixF: exp=1, iter= 4, size=300 5.985 18.125 17.19 33.17
Matrix: exp=1, iter= 4, size=300 10.219 22.016 27.19 42.46
MatrixF: exp=2, iter= 4, size=300 5.766 17.921 17.08 32.95
Matrix: exp=2, iter= 4, size=300 9.969 21.844 27.02 42.3
MatrixF: exp=3, iter= 4, size=300 5.719 17.875 17.08 32.95
Matrix: exp=3, iter= 4, size=300 9.937 21.766 26.97 42.18
These numbers were checked with Cafe's compiler set for
"debug" and "release", and the speed was equal in both cases.
public TestMatrix()
public String BNF(int lang)
public void unparse(Unparser u,
int lang)
public Object parse(Parser p,
int lang) throws ParserException
public void run()
public void test(int exp,
int iter,
int size)
public void testD(int exp,
int iter,
int size,
boolean useNative)