diff --git a/README.md b/README.md index c3b6d67..2007bd6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # java.math.expression.parser java math expression parser is a maven project that lets you parse or evaluate math expressions. -This algorithm does not use a decision tree. It is a kind of Recursive Ascent Parser (https://en.wikipedia.org/wiki/Recursive_ascent_parser). In fact, it is LR parser (Left-Right Parser) without backtracking. +This algorithm does not use a decision tree. It is a kind of Recursive Descent Parser (https://en.wikipedia.org/wiki/Recursive_descent_parser). In fact, it is LR parser (Left-Right Parser) without backtracking. This algorithm is faster than JEP math expresion parser!!! If you compare java.math.expression.parse and JEP, this algorithm only needs 25% of the time to parse the same expression as JEP. With other algorithms that use trees like: @@ -90,14 +90,17 @@ This algorithm is faster than JEP math expresion parser!!! If you compare java.m These are the results for the version 3.0 (master). You can check the speedTests in the project - Parser.simpleEval("6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 - + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4"); + Parser.simpleEval("6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 + -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4"); CPU: i7-6500U test 1: one execution: 3ms test 2: 100000 executions : 2100 ms --> mean time 0.021 ms per execution - test 3: one million executions: 16500 ms --> mean time 0.0165 ms per execution + (with graalvm-jdk-17.0.8+9.1 the total time is 754ms --> 0.00754 per execution) + test 3: one million executions: 16500 ms --> mean time 0.0165 ms per execution + (with graalvm-jdk-17.0.8+9.1 the total time is 7980ms --> 0,00798 per execution) This version is compiled for Java 1.6