Does your system support parallel execution of Java threads on multiple
processors? Otherwise I don't see how parallelization will gain much
since the Rete evaluation itself is clearly compile-time bound.

How are you timing these 53ms? Does this include input time for your facts?
Frequently, much of a program's elapsed time is saved by adopting a
better i/o strategy.

Also, IIRC, there was the Utitilities method comparing times. Have you
looked into possible speed gains there, i.e., what's the type of the
"date" attribute and how does that U-method work?

-W


On Tue, May 11, 2010 at 10:40 AM, djb <dbrownell83@hotmail.com> wrote:

Hi Drools squad,

This is a follow-up to my previous speed-related post.  By boss is still
pushing to get 35ms down a bit, and I'm looking at parallelization options.
I've looked through the forums, but not successfully...

The options I see, are:

1. KnowledgeBase partitioning (setting KnowledgeBaseConfiguration to use
multi-threads)
  - I tried this, and got the error pasted at the bottom.  My suspicion is
that it starts a thread, and meanwhile the Java thread continues, and
disposes of the session before evaluation is complete.

2. Creating multiple Java threads, each of which starts its own
KnowledgeSession.
  - I started this, but need to confirm that this is possible.  What's
happening currently, is that the Java thread continues, and closes my
database connection prematurely, and so, I am working on adding some sort of
counting-semaphore, to wait for all the threads to complete before
continuing the Java thread.

Should I pursue either of these ideas?  I will probably work on the second
today.  The other idea I had was to try Sequential Mode, but I don't think
my data is applicable to a StatelessKnowledgeSession.

Thanks,
Daniel


***************************
Partition task manager caught an unexpected exception: null
Drools is capturing the exception to avoid thread death. Please report stack
trace to development team.
java.util.concurrent.RejectedExecutionException
       at
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
       at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
       at
java.util.concurrent.ThreadPoolExecutor.ensureQueuedTaskHandled(ThreadPoolExecutor.java:758)
       at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:655)
       at
org.drools.reteoo.PartitionTaskManager.enqueue(PartitionTaskManager.java:75)
       at
org.drools.reteoo.AsyncCompositeObjectSinkAdapter.doPropagateAssertObject(AsyncCompositeObjectSinkAdapter.java:49)
       at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
       at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)
       at
org.drools.reteoo.PartitionTaskManager$FactAssertAction.execute(PartitionTaskManager.java:188)
       at
org.drools.reteoo.PartitionTaskManager$PartitionTask.run(PartitionTaskManager.java:112)
       at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)

--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parallelization-tp809341p809341.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users