Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0038197 | Openbravo ERP | A. Platform | public | 2018-03-22 13:12 | 2022-02-01 08:05 | |||||||
Reporter | gorkaion | |||||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | high | Severity | minor | Reproducibility | always | |||||||
Status | acknowledged | Resolution | open | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
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. | |||||||||||
Additional Information | ||||||||||||
Tags | Performance | |||||||||||
Relationships |
| |||||||||||
Attached Files | cost-adjustment-process-calltree.csv (24,214) 2018-03-22 13:12 https://issues.openbravo.com/file_download.php?file_id=11667&type=bug | |||||||||||
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 | bug_revision_view_page.php?rev_id=16913#r16913 | |||||||||
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 |
There are no notes attached to this issue. |