sathya_dev
sathya_dev

Reputation: 513

How to optimise Drools execution Performance?

We have 1000 rules under a single Rule flow Group We have severe performance issue while executing (around 10-20 secs)

We thought instead of having under single Rule Flow group,Splitting into multiple Agenda group will improve the performance.

Or creating multiple entry points increase the performance?

Anyone came across this problem?

Any Links /documentation also welcomed.

Upvotes: 2

Views: 3078

Answers (1)

laune
laune

Reputation: 31290

There was a similar issue several months ago on the Drools user list, and it was resolved successfully by a different approach according to may proposal. It may be applicable here, too.

Let's say there are some risk factors that influence the premium for a car insurance. Attributes are: age, previous incidents, amount of damage in previous incidents, gender, medical classification.

Each of these values influences the premium by a few credits.

You can write tons of rules like

Application( age <= 32 && <=35, previous == 1, damage <= 1000,
             gender == 'F', medical == 0.25 )
then
setPremium( 421 );

The proposed solution was to insert (constant) facts for each such parameter set and have a single rule that determines the matching parameter set and setting the premium from the field in the parameter set.

Upvotes: 2

Related Questions