Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2018-03-22 13:122018-04-26 16:55
ReportergorkaionView Statuspublic 
Assigned Toplatform 
PriorityhighResolutionopenFixed in Version
StatusacknowledgedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0038197: TreeTablesEventHandler performance issue on processes with lots of inserts

DescriptionThe Cost Adjustment Process can perform many inserts in the Cost Adjusment Line table. This table has a tree defined so on each insert the TreeTablesEventHandler.

Reviewing in YourKit the times consumed on each method during the process execution the TreeTablesEventHandler handler takes around 14% of the time.

out of 376 seconds of execution 48 are consumed by the handler: org.openbravo.costing.CostAdjustmentProcess.doProcessCostAdjustment(CostAdjustment) 376712
<16 calls> org.openbravo.client.application.event.TreeTablesEventHandler.onNew(EntityNewEvent) 48082

Attached a csv with the call tree exported from YourKit. Note that some other performance improvements have been applied to the process so the numbers might be different on a standard environment.
Steps To ReproduceCreate a Cost Adjustment that generates many lines and process it with YourKit profiling data.

Check the times consumed by each method and note that the TreeTablesEventHandler consumes too much time.

Example with F&B data.
1 Go to Product Window and select Cerveza Ale 0,5L
2 On Transactions Tab find the line of receipt:
      10000085 - 23-08-2012 - Bebidas Alegres, S.L. - 10 - Cerveza Ale 0,5L - 90000.00
3 Do a Manual Cost Adjustment with parameters (start YourKit profiling before clicking Done button):
   Amount: 50000
   Incremental: Yes
   Unit Cost: Yes
   Date: default
4 Check that process takes some seconds. Check that part of the time is spent on mentioned handler.
Proposed SolutionMost of the time is consumed retrieving the TableTree related to the CostAdjustmentLine table. The query always return the same return. This can be improved by caching it in ApplicationDictionaryCachedStructures or a similar class.

The next big time consumption is spent converting back to JSONObject the jsonBob. But in this case the the table uses LinkToParentTreeDatasourceService with does nothing in the addNewNode method so the initialization is useless.
Attached Filescsv file icon cost-adjustment-process-calltree.csv [^] (24,214 bytes) 2018-03-22 13:12

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0038205 closedcollazoandy4 Cost Adjustment Process very slow 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-03-22 13:12 gorkaion New Issue
2018-03-22 13:12 gorkaion Assigned To => platform
2018-03-22 13:12 gorkaion File Added: cost-adjustment-process-calltree.csv
2018-03-22 13:12 gorkaion Modules => Core
2018-03-22 13:12 gorkaion Resolution time => 1523484000
2018-03-22 13:12 gorkaion Triggers an Emergency Pack => No
2018-03-22 13:56 gorkaion Steps to Reproduce Updated View Revisions
2018-03-22 18:14 gorkaion Relationship added related to 0038205
2018-03-23 12:52 alostale Tag Attached: Performance
2018-03-23 13:06 gorkaion Priority urgent => high
2018-03-23 13:06 gorkaion Severity major => minor
2018-03-23 13:08 alostale Resolution time 1523484000 =>
2018-03-23 13:08 alostale Status new => acknowledged
2018-04-26 16:55 ngarcia Issue Monitored: ngarcia

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker