Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036172Openbravo ERPA. Platformpublic2017-06-02 14:292017-09-21 16:49
urgentmajorhave not tried
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


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] [^]
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
? wsah.jmx (11,849) 2017-07-27 12:13
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 => [^]
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

2017-07-31 09:11   
Repository: erp/devel/pi
Changeset: 3ec690db55fe0b4bae71617d1775ffe165e63bd6
Author: Asier Lostalé <asier.lostale <at>>
Date: Mon Jul 31 09:00:49 2017 +0200
URL: [^]

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/
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/
2017-08-04 13:20   
Code reviewed + tested OK.
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: [^]
Maturity status: Test