Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036755Openbravo ERPA. Platformpublic2017-08-31 10:312017-09-21 16:49
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036755: inefficient translate task
Translate task which looks in html, jrxml, srpt and fo files for labels that can be translated and updates ad_textinterfaces table is quite inefficient:

* It gets invoked 8 times (once for core and one for modules per each file extension), in case there is no module in development this task does nothing, but it performs the check 8 times.
* Performs the whole checks once per installed language (this is because long time ago this task generated translated files for each language installed).
* Executes updates with no change whenever a label is found to be in use
* All DB operations are performed in auto-commit mode adding an important overhead
* log is too verbose
1. With no modules in development
1.1. Execute ant translate (see eg. [1])
  -> it can take 5-10 seconds to check there is no module in development to finally not perform any operation, this is worse if the number of modules is bigger (ie. with 200 modules takes ~1min)

2. With all modules in developemnt
2.1 Execute ant translate (see eg. [2])
  -> it can take 40s-2min

---
[1] https://ci.openbravo.com/job/int-full-pgsql/3198/console [^]
[2] https://ci.openbravo.com/job/int-dbcons-pgsql/2994/console [^]
Improve all the topics described above.

With these changes in place, the improvement is:

1. With no modules in development, time is highly reduced to few ms (see eg. [3])
2. With all modules in development, time is reduced to ~2-3 sec (see eg. [4])

---
[3] https://ci.openbravo.com/view/try/job/try-full-pgsql/6270/console [^]
[4] https://ci.openbravo.com/view/try/job/try-dbcons-oracle/5669/console [^]
Performance
causes defect 0036824 closed alostale false DB modified positive detected after compile.complete 
Issue History
2017-08-31 10:31alostaleNew Issue
2017-08-31 10:31alostaleAssigned To => platform
2017-08-31 10:31alostaleModules => Core
2017-08-31 10:31alostaleTriggers an Emergency Pack => No
2017-08-31 10:31alostaleAssigned Toplatform => alostale
2017-08-31 10:31alostaleTag Attached: Performance
2017-08-31 10:31alostaleReview Assigned To => caristu
2017-08-31 10:55hgbotCheckin
2017-08-31 10:55hgbotNote Added: 0098746
2017-08-31 10:55hgbotStatusnew => resolved
2017-08-31 10:55hgbotResolutionopen => fixed
2017-08-31 10:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f8c3d0a4f7a47808cd21001bc5c258a98214dfbd [^]
2017-08-31 13:06shuehnerIssue Monitored: shuehner
2017-09-01 13:24hgbotCheckin
2017-09-01 13:24hgbotNote Added: 0098778
2017-09-01 13:25caristuNote Added: 0098779
2017-09-01 13:25caristuStatusresolved => closed
2017-09-01 13:25caristuFixed in Version => 3.0PR17Q4
2017-09-11 14:35alostaleRelationship addedcauses 0036824
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099349
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099351

Notes
(0098746)
hgbot   
2017-08-31 10:55   
Repository: erp/devel/pi
Changeset: f8c3d0a4f7a47808cd21001bc5c258a98214dfbd
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Aug 11 16:21:42 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f8c3d0a4f7a47808cd21001bc5c258a98214dfbd [^]

fixed bug 36755: inefficient translate task

  Several improvements applied:
    * A single invocation is performed instead one per file extension.
    * Look for labels just once regardless number of installed translations.
    * Cache all labels in memory so that a single query is performed to look for
      them up instead of one per each label found in files.
    * Execute all DB updates in a single transaction
    * Reduced log vebosity (specially when no modules in development)

---
M build.xml
M src-trl/src/org/openbravo/translate/Translate.java
M src-trl/src/org/openbravo/translate/Translate_data.xsql
M src/build.xml
---
(0098778)
hgbot   
2017-09-01 13:24   
Repository: erp/devel/pi
Changeset: 62f82f265b39a26266fd01879f7b1b820f3e0f61
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Sep 01 13:23:45 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/62f82f265b39a26266fd01879f7b1b820f3e0f61 [^]

related to issue 36755: avoid nested if

---
M src-trl/src/org/openbravo/translate/Translate.java
---
(0098779)
caristu   
2017-09-01 13:25   
Code reviewed + tested OK.
(0099349)
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
(0099351)
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