2 Replies Latest reply on Nov 27, 2011 7:42 AM by olddave

    Serious performance issue 5.1

    olddave Newbie



      My use of jBPM 5.1 is a little unusual. I have very simple workflows that take a record, carry out some simple manipulation and return the result at the end of that manipulation as a Parameter Mapping. In rare circumstances a Human Task might be required in the workflow logic to present the errant record for attention by a human. So I might have 1 million records, with maybe 12 that need attention. The remainder are all dealt with by the mvel logic in the workflow and a custom workflow item.


      I simply create the StatefulKnowledgeSession and call startProcess for each record. This is killing performance, profiling the method that has the startProcess call is using 99.5% of all CPU time, the rest is mostly outside the workflow and is persisting the altered record to the Db. Is there a better way?


      Here is theh basic call code


          params.put("transformData", tData);

          params.put("namedCaches", cacheQueries);



      ksession.startProcess( "_" + com.example.edm.core.utils.Utils.getRefId(transformationWorkflow.getUuid()), params);

      transform = tData.getValues();






        • 1. Re: Serious performance issue 5.1
          Tihomir Surdilovic Master

          Hi David, the creation of a session in Drools and jBPM is a very light-weight operation. Are you by chance re-building the KnowledgeBase as well each time, because that is a heavy-weight operation.

          • 2. Re: Serious performance issue 5.1
            olddave Newbie



            No I am the champion of lazy loading, so KnowledgeBase is built once. After getting drools setup as an Eclipse project I could use JVM Monitor to profile it, turns out it is my custom Work Item that allows the user to write Groovy scripts that does manipulation of the data in the records being processed. I have now added it to the Eclipse projects so will find out why. Having used it before and found it pretty performant, I expect it is how I am using it.