[rules-users] Evaluations are increasingly slower

sumantp sumantp at yahoo.com
Mon Jul 14 14:20:46 EDT 2014


Hi,

I have a rule that looks for 2 consecutive events for the same entity. To
stress test it, I inserted 10K consecutive events. I'm calling
fireAllRules() after each event is inserted. I'm printing out timestamps
after every 100 events. I'm noticing that insertions/evaluations are
increasingly slower. Here's the rule :

rule "Consecutive events"
when
	$latest : Event($id : id) // newest event
	not Event(id == $id, this after $latest) // no events after the newest
	$previous : Event(id == $id, this before $latest) // event before the
newest
	not Event(id == $id, this before $latest, this after $previous) // no
events between $latest and $previous
then
	//System.out.println($latest.toString());
end

It is my understanding that the above rule should only match the latest 2
events and automatic memory management should remove older events. If so,
why are insertions progressively slower? Interestingly,
ksession.getObjects() returns all the events inserted and not just the
latest 2 events. Is my understanding of the rule incorrect? Does the rule
somehow force all events to stay in memory?

Thanks,
Sumant



--
View this message in context: http://drools.46999.n3.nabble.com/Evaluations-are-increasingly-slower-tp4030345.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list