Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
ID | |||||||||||
0038197 | |||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||
defect | [Openbravo ERP] A. Platform | minor | always | 2018-03-22 13:12 | 2022-02-01 08:05 | ||||||
Reporter | gorkaion | View Status | public | ||||||||
Assigned To | Triage Platform Base | ||||||||||
Priority | high | Resolution | open | Fixed in Version | |||||||
Status | acknowledged | Fix in branch | Fixed in SCM revision | ||||||||
Projection | none | ETA | none | Target Version | |||||||
OS | Any | Database | Any | Java version | |||||||
OS Version | Database version | Ant version | |||||||||
Product Version | SCM revision | ||||||||||
Review Assigned To | |||||||||||
Web browser | |||||||||||
Modules | Core | ||||||||||
Regression level | |||||||||||
Regression date | |||||||||||
Regression introduced in release | |||||||||||
Regression introduced by commit | |||||||||||
Triggers an Emergency Pack | No | ||||||||||
Summary | 0038197: TreeTablesEventHandler performance issue on processes with lots of inserts | ||||||||||
Description | The 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: CancelCostAdjustment.java:145 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 Reproduce | Create 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 Solution | Most 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. | ||||||||||
Tags | Performance | ||||||||||
Attached Files | cost-adjustment-process-calltree.csv [^] (24,214 bytes) 2018-03-22 13:12 | ||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
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 | |
2022-02-01 08:05 | alostale | Assigned To | platform => Triage Platform Base |
Copyright © 2000 - 2009 MantisBT Group |