uklimaschewski/EvalEx — pull request #3 by squeek502 (2014-05-25 06:09:20+00:00)
Title: Moved variable substitution to eval()

* Adds support for reusing a single Expression instance whenever evaluating an unchanging expression with different values of any variable(s)

Here are some test results over 1,000,000 iterations:
```
testSimpleNoCaching: 2.881s
testSimpleWithCaching: 0.943s
testComplexNoCaching: 14.017s
testComplexWithCaching: 5.842s
```

Test code:
```
package com.udojava.evalex;

import static org.junit.Assert.*;
import java.math.BigDecimal;
import org.junit.Test;

public class TestRPNCache
{
public static final int numIterations=1000000;
public static final String simpleExpression = "a+b";
public static final String complexExpression = "MIN(MAX(a^(1*1)+0+(b*1), a*1+b/(1+(0/1)+0)-(0^(1))), a+b)";

@Test
public void testSimpleWithCaching()
{
Expression e = new Expression(simpleExpression);
for (int a=0, b=numIterations; a