Class SpeedTestComplex
- java.lang.Object
-
- com.singularsys.jepexamples.diagnostics.SpeedTestComplex
-
public class SpeedTestComplex 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpeedTestComplex.EvaluationConfigBasic class to set the evaluation contextstatic classSpeedTestComplex.JepConfigStandard Jep configuration (with FastEvaluator)static classSpeedTestComplex.JepConfig3_4Standard Jep configuration (with FastEvaluator)static classSpeedTestComplex.JepConfig3_5static classSpeedTestComplex.JepConfig3_5NCstatic classSpeedTestComplex.JepConfigNoChecksStandard Jep configuration (with FastEvaluator)static classSpeedTestComplex.OldConfigConfiguration using the StandardEvaluatorstatic classSpeedTestComplex.OutputterDifferent output methodsstatic classSpeedTestComplex.PostfixConfigConfiguration using the RealEvaluatorstatic classSpeedTestComplex.RatioOutputterPrint detailed ratios for each run.static classSpeedTestComplex.RealConfigConfiguration using the RealEvaluatorstatic classSpeedTestComplex.TabOutputterPrint output tab separated.static classSpeedTestComplex.ThreadSafeConfigConfiguration using the RealEvaluatorstatic classSpeedTestComplex.UncheckedConfig
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SpeedTestComplex.EvaluationConfig>configsintnDerivintnum_ittsintnum_valsintnum_warmupprotected SpeedTestComplex.Outputteroutputterprotected long[]totalTimes
-
Constructor Summary
Constructors Constructor Description SpeedTestComplex(SpeedTestComplex.Outputter outputter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfig(SpeedTestComplex.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.voidrunTests()A standard set of tests.
-
-
-
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<SpeedTestComplex.EvaluationConfig> configs
-
outputter
protected SpeedTestComplex.Outputter outputter
-
totalTimes
protected long[] totalTimes
-
-
Constructor Detail
-
SpeedTestComplex
public SpeedTestComplex(SpeedTestComplex.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(SpeedTestComplex.EvaluationConfig config)
Adds a new EvaluationConfig to be be run for comparison.- Parameters:
config-
-
main
public static void main(java.lang.String[] args)
Main method, executes all speed tests. Arguments '-pause' causes the program to wait for keyboard input before running test, useful use in profilers. Or a number specifying number of iterations to run.- Parameters:
args- Can contain '-pause' or NUM
-
runTests
public void runTests()
A standard set of tests.
-
-