It would help to know the times before and after the point marked
with (X) below.
1000 fields is weird. I'm inclined to think that there ought to be a
better way...
-W
On 04/10/2012, Phani Saripalli <saripalli.phani(a)gmail.com> wrote:
HI.
I am using declared types in my .drl file. I have a declared type with 1000
fields (using the Drools 5.5. beta, so 1000 fields is allowed). I have 100
rules. However, creating the stateful knowledge base is very slow. It is
taking nearly 8 seconds. Can somebody tell me, suggest how can I speed up
the process?
Briefly, this is how I measured.
long loadI = System.currentTimeMillis();
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
ksession.setGlobal("cList", new ArrayList<Integer>());
FactType fact = kbase.getFactType("com.sample",
"Project");
// (X)
Object projIns = fact.newInstance();
ksession.insert(projIns);
long loadO = System.currentTimeMillis();
System.out.println("time to load facts : " + ((loadO / 1000.0)
-
(loadI / 1000.0)));
ksession.getAgenda().getAgendaGroup("Group Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Fact Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 0").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 1").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 2").setFocus();
ksession.fireAllRules();
Many thanks
Phani
--
View this message in context:
http://drools.46999.n3.nabble.com/Speeding-up-Drools-tp4020132.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users