[rules-users] Bulk-Retract speed conundrum

djb dbrownell83 at hotmail.com
Fri May 7 04:05:38 EDT 2010


Hi Edson,

Thanks for your suggestions.  They were very helpful, and I managed to drop
it down to 130ms.  

The changes I made were:

-The superfluous last condition (with the collect(...)) is only relevant
when the variable is non-zero, so I've changed the values in the rule
template from 0 to blank, and used the commenting trick to blank out those
lines when the condition is irrelevant.

-Putting the check for type before the check for code.

-The inline eval did not improve speed, in fact, it decreased the speed
slightly.

-disposing the session instead of retracting

So, the rule now looks so:
rule "RULE_2090"
when
	$cl: ClaimLine(historic == false, type == "T", code == 000000003908)
	$historic: ClaimLine(historic == true, type == "P", code >= 000000000052 &&
<= 000000000052, $dt : date)		
	eval(Utilities.isWithinTimePeriod($dt, $cl.date, "Y", "99"))
then
	String ruleName = drools.getRule().getName();
	results.addMessage(ruleName, "000000003908","Only 1 test per day                              
");
	results.setRefer("R");
end

My boss is however, pushing to perhaps find the last trick in the bag.  I'm
hoping there is still something I have overlooked.


(@Wolfgang) - since its a rule template, i'm not aware of any tricks to
conditionally show the =</>= vs. == depending on whether the values are the
same.  I suppose I could make two templates, and pre-process the result sets
to differentiate between the two.  Is there there an easier way?  It seems a
bit arbitrary to partition in that manner.

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Bulk-Retract-speed-conundrum-tp779188p783157.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list