Openbravo Issue Tracking System - Modules
View Issue Details
0030586ModulesInitial data loadpublic2015-08-14 14:042015-09-11 06:33
gorkaion 
aferraz 
urgentmajoralways
closedfixed 
30
 
 
dmiguelez
0030586: Performance issues in IDL for Variants
There are performance issues in the IDL for Variants module when having variant characteristics with a high number of available values.

Having a Color characteristic with ~ 1500 values and a Size characteristic with ~ 20 values.

The import of generic products adding those characteristics as variants takes ~ 15 seconds for each product.
The import of variants for those products also takes several seconds when they shouldn't.
Create a characteristic color with 1500 values.
Create a characteristic size with 20 values.
Create a csv file with 10 products using those characteristics as variants.
Import the file and check the times.

It might be necessary to add some log information to the ImportProduct class.
After a simple research the following issues have been detected:
- For each generic all the available values of the characteristics are loaded in the Characteristic Conf tab. This is managed by the ProductCharacteristicEventHandler event handler. The generation of those records is expected but the flush after this event handler is very slow as all the conf records (~ 1500) are loaded in the session.
- When the variants are created a copy of the generic product is done copying all the children entities. This also copies the Conf values of the generic product. These values should be deleted and removed from the session.
No tags attached.
related to feature request 0030726 closed gorkaion Implement is explode configuration tab 
Issue History
2015-08-14 14:04gorkaionNew Issue
2015-08-14 14:04gorkaionAssigned To => jonalegriaesarte
2015-08-14 14:04gorkaionDescription Updatedbug_revision_view_page.php?rev_id=9209#r9209
2015-08-14 14:04gorkaionProposed Solution updated
2015-08-14 14:43maiteResolution time => 1442181600
2015-08-14 14:43maiteAssigned Tojonalegriaesarte => Triage Finance
2015-08-14 14:43maiteIssue Monitored: networkb
2015-08-14 14:46maitePrioritynormal => urgent
2015-09-02 11:10vmromanosStatusnew => scheduled
2015-09-02 11:10vmromanosAssigned ToTriage Finance => aferraz
2015-09-03 16:41gorkaionRelationship addedrelated to 0030726
2015-09-03 16:43gorkaionNote Added: 0080059
2015-09-07 13:38hgbotCheckin
2015-09-07 13:38hgbotNote Added: 0080195
2015-09-09 17:45hgbotCheckin
2015-09-09 17:45hgbotNote Added: 0080285
2015-09-09 17:45hgbotStatusscheduled => resolved
2015-09-09 17:45hgbotResolutionopen => fixed
2015-09-09 17:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b4dbd8ccb5cafdc7be74b5a94d13c249f7f3a439 [^]
2015-09-09 17:54dmiguelezReview Assigned To => dmiguelez
2015-09-09 17:54dmiguelezNote Added: 0080287
2015-09-09 17:54dmiguelezStatusresolved => closed
2015-09-11 06:33hudsonbotCheckin
2015-09-11 06:33hudsonbotNote Added: 0080321

Notes
(0080059)
gorkaion   
2015-09-03 16:43   
After implementing feature requests 0030724 and 0030726 and configuring the characteristic color to not exploding the configuration tab the time per product is reduced to ~ 150ms
(0080195)
hgbot   
2015-09-07 13:38   
Repository: erp/pmods/org.openbravo.idl.variants
Changeset: b922baccc06a6b6d5641da0b18e944c84e4e509f
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Sep 04 14:49:04 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.idl.variants/rev/b922baccc06a6b6d5641da0b18e944c84e4e509f [^]

Related to issue 30586: Performance problems in ProductCharacteristicEventHandler

Remove ProductCharacteristicConf list from copied Product in ImportProduct process.

---
M src/org/openbravo/idl/variants/ImportProduct.java
---
(0080285)
hgbot   
2015-09-09 17:45   
Repository: erp/devel/pi
Changeset: b4dbd8ccb5cafdc7be74b5a94d13c249f7f3a439
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Sep 04 14:47:22 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b4dbd8ccb5cafdc7be74b5a94d13c249f7f3a439 [^]

Fixes issue 30586: Performance problems in ProductCharacteristicEventHandler

Many loops inside ProductCharacteristicEventHandler have been replaced or removed.
Loops to check if there is any wrong result, have been replaced with a unique result query.
Loops inside getValuesToAdd method have been replaced with a query and results will be returned with a ScrollableResults.
Loop to retrieve existingValues has been replaced with a query.

---
M src/org/openbravo/event/ProductCharacteristicEventHandler.java
---
(0080287)
dmiguelez   
2015-09-09 17:54   
Code Review + Testing Ok
(0080321)
hudsonbot   
2015-09-11 06:33   
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/2828f6cbe752 [^]
Maturity status: Test