Performance of MVEL 2.0

MVEL 2.0 continues in the tradition of MVEL 1.2/1.3 of going for high performance expression evaluation.


The above graph (click it to enlarge) demonstrates the performance differences for some simple benchmarks applied against other popular embeddable scripting languages.

Shorter bars mean higher performance.

The No Cache values indicate performance with no caching, or re-use of resources such as resolvers, factories, etc. Each iteration in this category represents a cold start of the parser, all the way to the result of the expression. In MVEL's case, this is generally referred to as interpreted performance. The performance of the libraries in this respect can generally be used to evaluate how efficiently they actually parse the expression.

The Cache values indicate performance with caching, including reuse of any resolvers or factories that would normally be used. This may not be reflective of real-world performance, as it may not be practical to maintain cache of variable resolvers over a long period of time. But the benchmark allows for this none the less.

For these tests, MVEL and Groovy were the only implementations capable of running the Compiled tests. The compiled tests measure performance with bytecode generation. Although OGNL 2.7.2 supports bytecode generation, it only supports bytecode generation against root context objects. All of these tests took advantage of variable injection, and therefore it was not possible to test OGNL's Javassist bytecode compiler.

Groovy was not tested for No Cache values. This is because Groovy's compiler is too slow to reasonably test. 25,000 compiles in Groovy took in excess of 5 minutes. Interestingly, the compiled tests for Groovy yielded slower performance than both MVEL and JEXL. The compiled test for Groovy used the same groovy.lang.Script Object for each iteration, and did not re-inject variables.

Results and Observations

MVEL has the fastest parser and compiler, by far.

MVEL outperforms all other implementations on all benchmarks except for the arithmetic performance benchmark where JEXL and MVEL are tied (12ms for 50,000 iterations).

Groovy has the slowest compiler, followed by JUEL and then OGNL.

OGNL has the worst cached performance for reflection, followed by JEXL.

OGNL has the worst performance for the nested map benchmark. This benchmark involves resolving a property from within a Map using the indexer syntax (foo['bar']['something']).

Groovy's compiler is far too slow to use in an ad hoc way.

Raw Result Data

Update: New Performance Comparisons for MVEL 2.0.14

Powered by Atlassian Confluence