Search code examples
drools

How to tell Drools to "JIT"-compile all the MVEL to Java?


Drools has a JIT feature, which I've found to be counter-productive for my use-case, it's not aggressive enough about compiling the MVEL into Java. How can I configure it to compile as much as possible as early as possible?


Solution

  • This is not configurable and is hard-coded to the value 20 (number of iterations before JIT occurs) in org.drools.core.rule.constraint.MvelConstraint, line 63 (in version 6.2.0.Final):

    protected static final int JIT_THRESOLD = 20; // Integer.MAX_VALUE;
    

    After additional investigation it turns out I found no reason to change this setting. YMMV.