Class SpeedTest
- java.lang.Object
-
- com.singularsys.jepexamples.diagnostics.SpeedTest
-
- Direct Known Subclasses:
MatrixSpeedTest
public class SpeedTest extends java.lang.ObjectCompares the speed of evaluation between different evaluation schemes. The standard class compares BigDecimal, Jep (with default Fast evaluator), the old StandardEvaluator, and RealEvaluator.If you have some nice complicated examples, I'd love to hear about them to see if we can tune things up. - rich
Command line arguments:
-pausecause the program to wait for keyboard input before running tests, can be useful for running in a debugger;1000000sets the number of iterations to used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpeedTest.BDConfigConfiguration using the BDConfigstatic classSpeedTest.EvaluationConfigBasic class to set the evaluation contextstatic classSpeedTest.JepConfigStandard Jep configuration (with FastEvaluator)static classSpeedTest.JepConfig3_4Standard Jep configuration (with FastEvaluator)static classSpeedTest.JepConfig3_5static classSpeedTest.JepConfig3_5NCstatic classSpeedTest.JepConfigNoChecksStandard Jep configuration (with FastEvaluator)static classSpeedTest.OldConfigConfiguration using the StandardEvaluatorstatic classSpeedTest.OutputterDifferent output methodsstatic classSpeedTest.PostfixConfigConfiguration using the RealEvaluatorstatic classSpeedTest.RatioOutputterPrint detailed ratios for each run.static classSpeedTest.RealConfigConfiguration using the RealEvaluatorstatic classSpeedTest.TabOutputterPrint output tab separated.static classSpeedTest.ThreadSafeConfigConfiguration using the RealEvaluatorstatic classSpeedTest.UncheckedConfig
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SpeedTest.EvaluationConfig>configsintnDerivintnum_ittsintnum_valsintnum_warmupprotected SpeedTest.Outputteroutputterprotected long[]totalTimes
-
Constructor Summary
Constructors Constructor Description SpeedTest(SpeedTest.Outputter outputter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfig(SpeedTest.EvaluationConfig config)Adds a new EvaluationConfig to be be run for comparison.voiddoAll(java.lang.String[] eqns, java.lang.String[] varNames)Run speed comparison for a set of equations.voiddoAll(java.lang.String eqn, java.lang.String[] varNames)Run speed comparison for a single equation.voidfini()voidinit()static voidmain(java.lang.String[] args)Main method, executes all speed tests.static voidrunTests(SpeedTest st)A standard set of tests.static voidrunTests2(SpeedTest st)
-
-
-
Field Detail
-
num_itts
public int num_itts
-
num_warmup
public int num_warmup
-
num_vals
public int num_vals
-
nDeriv
public int nDeriv
-
configs
protected final java.util.List<SpeedTest.EvaluationConfig> configs
-
outputter
protected SpeedTest.Outputter outputter
-
totalTimes
protected long[] totalTimes
-
-
Constructor Detail
-
SpeedTest
public SpeedTest(SpeedTest.Outputter outputter)
- Parameters:
outputter-
-
-
Method Detail
-
init
public void init()
-
fini
public void fini()
-
doAll
public void doAll(java.lang.String eqn, java.lang.String[] varNames)Run speed comparison for a single equation.- Parameters:
eqn- The equation to testvarNames- an array of variable names which will be set to random values.
-
doAll
public void doAll(java.lang.String[] eqns, java.lang.String[] varNames)Run speed comparison for a set of equations.- Parameters:
eqns-varNames-
-
addConfig
public void addConfig(SpeedTest.EvaluationConfig config)
Adds a new EvaluationConfig to be be run for comparison.- Parameters:
config-
-
runTests2
public static void runTests2(SpeedTest st)
-
runTests
public static void runTests(SpeedTest st)
A standard set of tests.- Parameters:
st-
-
main
public static void main(java.lang.String[] args)
Main method, executes all speed tests.- Parameters:
args-
-
-