-
1. Re: jBPM performance
kukeltje Dec 9, 2005 1:21 PM (in response to ashkumar)how do you insert the tasks? do you have sample code? Or better, write a unit test for it. Then we can check how it runs here.
-
2. Re: jBPM performance
ashkumar Dec 12, 2005 10:53 PM (in response to ashkumar)Hi,
I did some timing and narrowed down the problem to the worst offender.private static Map getMap (TaskInstance tInstance) { List formParameters = tInstance.getTaskFormParameters(); Object object = null; Map taskMap = new HashMap (); taskMap.put("taskId", new Long(tInstance.getId())); Iterator iter = formParameters.iterator(); while (iter.hasNext()) { TaskFormParameter tfp = (TaskFormParameter) iter.next(); String label = tfp.getLabel(); object = tfp.getValue(); taskMap.put(label, object); } return taskMap; }
I have a list of TaskInstances. (2000 in number). When I iterate over this list to get a Map of all the formParameters using the above method, it seems to take 8 minutes.
One run of the above method is approximately 200 milliseconds. For 2000 TaskInstances, it is 400000 milliseconds.
This is an unacceptable performance. Maybe it is lazy loading the formparameters. Is there any way to improve the performance of the above?
Thanks, -
3. Re: jBPM performance
ashkumar Dec 13, 2005 12:24 AM (in response to ashkumar)I have discovered that this particular line
List formParameters = tInstance.getTaskFormParameters();
is particularly time consuming. Almost 200 milliseconds per iteration. Any ideas why this may be the case?
We have to assign variables (Form parameter) to tasks. After all it is only these variables that qualify the task. So, if we cannot do without these variables, how do we increase performance?
Thanks, -
4. Re: jBPM performance
kukeltje Dec 13, 2005 2:17 AM (in response to ashkumar)hmm... this is one for Tom, I'll notify him of this issue.
-
5. Re: jBPM performance
tom.baeyens Dec 13, 2005 8:43 AM (in response to ashkumar)i would expect the getMap only to be called after 1 specific task instance is selected. and not e.g. to show the task list.
do you see this behaviour in the jbpm webapp or is it your own code ?Is there any way to improve the performance of the above?
probably lots of options. just a matter of exploring them.
regards, tom. -
6. Re: jBPM performance
kukeltje Dec 13, 2005 10:26 AM (in response to ashkumar)The current jBPM webapp does not iterate over taskinstances. So it probably is a home-grown webapp. I can see caes however where info from a task needs to be displayed in the task-list. If a paged task-list is used and the data is fetched lazy, it should 'only' take 10*200ms = 2 seconds, which is imo still a lot. Certainly if just one element needs to be displayed in the tasklist.
I think I can easily add the functionality to just load one taskFormParameter from the database. -
7. Re: jBPM performance
ashkumar Dec 13, 2005 1:58 PM (in response to ashkumar)I have 4 Integers associated with a taskInstance that are persisted in jbpm database.
Strangely, retrieval of only one Integer takes a very long time. All others are retrieved very quickly.Object value = contextInstance.getVariable(variableAccess.getVariableName(), token);
the above line in TaskController is the one that takes a long time (150 milli seconds). As I understood, this line does not interface with the database further down the hierarchy. So what is causing the problem (time delay) with this one particular form variable?
Regards, -
8. Re: jBPM performance
enazareno Dec 13, 2005 9:00 PM (in response to ashkumar)Hi,
If all else fails, why not just use the traditional approach and query the database directly and use paging? Maybe you also need to check if the tables are properly indexed.
Regards,
Elmo