Affects Version/s: 2.3
Component/s: User Interface
Security Level: Public (Public: Anyone can view)
KAI Review Status:Not Required
KTI Review Status:Not Required
Code Review Status:Not Required
Include in Release Notes?:Yes
Performance issue caused by too many recursions:
Email from Dan:
Perhaps the handleMessagesAtGroup and writeMessagesForGroup could return the data containing the calculations and sum the counts as the tree is traversed.
If you are traversing from a node up through its parent, the parent’s count could be updated with the difference in the child’s count until you reach the root node. That way you don’t need to call recursiveGroupMessageCount, you just need to update from the change in error count in handleMessagesAtField to the top.
Otherwise (or to get initial counts) you could do a count by starting at the root node and traversing the tree, setting the count of each node to the sum of the children and recursing. This is sort of what calculateMessageTotals does, except it only records the values for the root node, not the entire tree, even though it recurses through the entire tree.
The problem right now is that if handleMessagesAtField is called on the following tree:
calculateMessageTotals is called on node D, which traverses D to get totals
calculateMessageTotals is called on node C, which traverses C and D to get totals
calculateMessageTotals is called on node B, which traverses B,C and D to get totals
calculateMessageTotals is called on node A, which traverses A,B,C and D to get totals
so D gets calculated 4 times, C 3, and B 2
From: Brian Smith firstname.lastname@example.org
Sent: Monday, July 01, 2013 3:35 PM
I can look into the performance on this particular method, please give any suggestions you may have in improving performance here (maybe only run once somehow?).
Also, another concern is what situation is the user getting themselves into where they have 30 warnings?
On 7/1/2013 12:10 PM, Daniel S Epstein wrote:
A lot of the time spent is in the calculateMessageTotals function, which is called recursively from handleMessagesAtField. In turn, caclculateMessageTotals calls recursiveGroupMessageCount. Because this is called recursively for each node , the calculateMessageTotals operation is called dozens of times even though it always returns the same value. These calculations should be done in O time.
You received this message because you are subscribed to the Google Groups "Rice KRAD User Group" group.
Visit this group at http://groups.google.com/a/kuali.org/group/rice.usergroup.krad/.
To view this discussion on the web visit https://groups.google.com/a/kuali.org/d/msgid/rice.usergroup.krad/457ADF0F0F3CD14BB49760FE098AC209A5233A%40OITMX1004.AD.UMD.EDU.