Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036172Openbravo ERPA. Platformpublic2017-06-02 14:292017-09-21 16:49
alostale 
alostale 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036172: WindowSettingsActionHandler underperformance
WindowSettingsActionHandler which is executed whenever a window is opened, has several performance problems from the code point of view:

* Retrieving window from DB + DAL: using ADCS would prevent it
* Querying one by one WindowAccessData.hasReadOnlyAccess all the tabs in the window, could be implemented in a single query
* Getting preferences once and again
* Review also PersonalizationHandler
* For the window all ad_window_access rows are loaded in memory to iterate them and select only the current one. This is specially problematic having many roles.
* When there are ad_tab_access, all fields in the tab are included in the response, but it should be possible, if properly handled in client, to include only the ones with a different setting than the tab access
* ...
1.1. Check it in actual customers

or

2.1 Execute attached scripts (for different cases):
   -case 0: clean sample data
   -case 1: ad_tab_access to current role for all tabs in product
   -case 2: case 1 + ad_field_access to current role for all fields in product
   -case 3: 10K roles with access to product window
2.2 Execute attached jmeter: which performs 200 synchronous requests to WSAH for Product window (as it has many tabs)
Finally, not all fix candidates have been implemented as some of them were more risky and with current fix we've managed to get stable response times <40ms (for cases where originally were >400ms) regardless configuration settings [1].

Also a much better heap consumption has been achieved.

---

[1] https://docs.google.com/spreadsheets/d/1p-KK0gEHj2QjIgKP6tpuPzJ3QW-5M3c9P6hwKVwu0GM/edit#gid=1009287793 [^]
Performance
related to defect 0035260 closed alostale unneeded flushes in window settings action handler 
related to defect 0036066 closed alostale no updateable AD definition can be overwritten by role config 
depends on feature request 00349753.0PR17Q2 closed alostale change scope of ADCS to ApplicationScoped 
? WSAH-plan-config.sql (4,851) 2017-07-27 12:12
https://issues.openbravo.com/file_download.php?file_id=10934&type=bug
? wsah.jmx (11,849) 2017-07-27 12:13
https://issues.openbravo.com/file_download.php?file_id=10935&type=bug
Issue History
2017-06-02 14:29alostaleNew Issue
2017-06-02 14:29alostaleAssigned To => platform
2017-06-02 14:29alostaleModules => Core
2017-06-02 14:29alostaleTriggers an Emergency Pack => No
2017-06-02 14:29alostaleTag Attached: Performance
2017-06-02 14:29alostaleRelationship addedrelated to 0035260
2017-06-02 14:30alostaleRelationship addedrelated to 0036066
2017-06-02 14:31alostaleStatusnew => acknowledged
2017-07-26 13:53alostaleFile Added: windowSettingsAH.sql
2017-07-27 12:12alostaleFile Deleted: windowSettingsAH.sql
2017-07-27 12:12alostaleFile Added: WSAH-plan-config.sql
2017-07-27 12:13alostaleAssigned Toplatform => alostale
2017-07-27 12:13alostaleFile Added: wsah.jmx
2017-07-27 12:16alostaleRelationship addeddepends on 0034975
2017-07-27 12:23alostaleReview Assigned To => caristu
2017-07-27 12:23alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15553#r15553
2017-07-27 12:23alostaleProposed Solution updated
2017-07-27 12:24alostaleProposed Solution updated
2017-07-31 09:11hgbotCheckin
2017-07-31 09:11hgbotNote Added: 0098266
2017-07-31 09:11hgbotStatusacknowledged => resolved
2017-07-31 09:11hgbotResolutionopen => fixed
2017-07-31 09:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3ec690db55fe0b4bae71617d1775ffe165e63bd6 [^]
2017-08-04 13:20caristuNote Added: 0098393
2017-08-04 13:20caristuStatusresolved => closed
2017-08-04 13:20caristuFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099287

Notes
(0098266)
hgbot   
2017-07-31 09:11   
Repository: erp/devel/pi
Changeset: 3ec690db55fe0b4bae71617d1775ffe165e63bd6
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jul 31 09:00:49 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3ec690db55fe0b4bae71617d1775ffe165e63bd6 [^]

fixed bug 36172: WindowSettingsActionHandler underperformance

  Several changes in WindowSettingsActionHandler performance which improve both
  processing time and heap memory consumption:
    - Use ADCS to query window/tab definition in order to prevent DB queries
    - Optimized DAL queries so that only relevant records are queries from DB and
      loaded in memory

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
---
(0098393)
caristu   
2017-08-04 13:20   
Code reviewed + tested OK.
(0099287)
hudsonbot   
2017-09-21 16:49   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test