Print
Fast Reflection Evaluation Tree

The Fast Reflection Evaluation Tree (FRET) is a built-in JIT (org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer) implementation that is part of the standard MVEL distribution.

The JIT produces a tree of nodes, which contains pre-resolved reflection targets for all the elements in an expression. This provides increased reflection performance (without bytecode enhancement) by negating the need to resolve classes, methods and fields during evaluation of the expression.

Why?

This JIT may be preferable to the bytecode JIT for memory sensitive applications, or applications that generate expressions on the fly.

This is JIT is used as the preferred mode in JBoss Drools.

Performance Note

In general, this JIT produces performance about one order of magnitude (10x) slower than the bytecode JIT and native java code. That being said, the overhead is negligible in most REAL cases, and one should note that while this JIT may be an order of magnitude slower than native code, it is also produces code about two orders of magnitude faster than straight-up reflection calls.

Powered by Atlassian Confluence