L
Lionel
Hi all,
I have an equation that gets executing many thousands of times by an
algorithm. When I it is written in code the algorithm is quite fast.
However, I want the user to be able to define the equation themselves,
to solve it this way I use java expression parser (JEP).
For a test example, the algorithm using the hard coded version runs in
about 2 seconds, but using JEP, it takes in the order of 50 seconds! The
expression is only parsed once by JEP, but evaluated many times with
different values.
The expression I'm using looks like: A - (B / C) * D
Does anyone know if such a time difference is expected, and secondly, a
possible faster way of doing this?
Thanks
Lionel.
I have an equation that gets executing many thousands of times by an
algorithm. When I it is written in code the algorithm is quite fast.
However, I want the user to be able to define the equation themselves,
to solve it this way I use java expression parser (JEP).
For a test example, the algorithm using the hard coded version runs in
about 2 seconds, but using JEP, it takes in the order of 50 seconds! The
expression is only parsed once by JEP, but evaluated many times with
different values.
The expression I'm using looks like: A - (B / C) * D
Does anyone know if such a time difference is expected, and secondly, a
possible faster way of doing this?
Thanks
Lionel.