Question

we are using Drools Planner 5.4.0.Final. We want to profile our java application to understand if we can improve performance. Is there a way to profile how much time a rule needs to be evaluated? We use a lot of eval(....) and our "average calculate count per second" is nearly 37. Removing all eval(...) our "average calculate count per second" remains the same.

We already profiled the application and we saw most of the time is spent in doMove ... afterVariableChanged(...).

So we suspect some of our rules are inefficient, but we don't understand where is the problem.

Thanks!

Was it helpful?

Solution

A decent average calculate count per second is higher than 1000 (at least), a good one higher than 5000. Follow these steps in order:

1) First, I strongly recommend to upgrade to to 6.0.0.CR5. Just follow the upgrade recipe which will guide you step by step in a few hours. That alone will double your average calculate count (and potentially far more), due to several improvements (selectors, constraint match system, ...).

2) Open the black box by enabling logging: first DEBUG, then TRACE. The logs can show if the moves are slow (= rules are slow) or the step initialization is slow (= you need JIT selection).

3) Use the stepLimit benchmark technique to find out which rule(s) are slow.

4) Use the benchmarker (if you aren't already) and play with JIT selection, late acceptance, etc. See those topics in the docs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top