Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033605
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-08-02 17:262016-10-14 09:19
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revisionfbbbd0d5bd13
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033605: OrgTree.getAccessibleTree is very slow with many organizations

DescriptionThis function is very slow >1s in a system with many orgs (524).

Most of that slowdown comes from bad coding of loops here.
- for (int i = 0; i < nodes.toArray().length; i++) {
+ for (int i = 0; i < nodes.size(); i++) {

In many functions of that class to get to the size of a java.util.list the above is used which create a new array from the list to get to the size of that tmp array and throws it away.

As that is being done very very often in the calculation it a major pain point.

Just changing that like shown in the above diff drops runtime from >1s down to 50ms
Steps To ReproduceTrigger above code in a system with i.e. 524 orgs.

Found in flow POSLoginHandler (which runs fillSessionArguments which runs above function)
TagsPerformance
Attached Filesdiff file icon 33605_prototype.diff [^] (3,113 bytes) 2016-08-02 17:27 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0033602 newTriage Finance LoginUtils.fillSessionArguments (query Attribute.selectOrgCurrency quite slow) around 100ms with many orgs 
blocks defect 0035729 closedalostale Performance issue in Financial Account when having high number of Organizations 

-  Notes
(0089307)
hgbot (developer)
2016-08-23 15:30

Repository: erp/devel/pi
Changeset: fbbbd0d5bd13f0a59455446e0de48dd9a5a4b576
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Tue Aug 23 15:29:22 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fbbbd0d5bd13f0a59455446e0de48dd9a5a4b576 [^]

Fixed 33605. Simplify & speedup OrgTree functions with many organizations.

Code in OrgTree.java used strange pattern to loop over its internal (Array)List
of notes.

- for (int i = 0; i < nodes.toArray().length; i++) {
+ for (int i = 0; i < nodes.size(); i++) {

That makes code harder to read and create/copy of those temporary arrays has
a noticable performanc cost in a system with many organizations.

---
M src/org/openbravo/base/secureApp/OrgTree.java
---
(0089380)
caristu (developer)
2016-08-25 10:39

Code reviewed

- Issue History
Date Modified Username Field Change
2016-08-02 17:26 shuehner New Issue
2016-08-02 17:26 shuehner Assigned To => platform
2016-08-02 17:26 shuehner Modules => Core
2016-08-02 17:26 shuehner Triggers an Emergency Pack => No
2016-08-02 17:27 shuehner File Added: 33605_prototype.diff
2016-08-11 20:09 shuehner Tag Attached: Performance
2016-08-23 14:56 shuehner Relationship added related to 0033602
2016-08-23 15:04 shuehner Review Assigned To => caristu
2016-08-23 15:30 hgbot Checkin
2016-08-23 15:30 hgbot Note Added: 0089307
2016-08-23 15:30 hgbot Status new => resolved
2016-08-23 15:30 hgbot Resolution open => fixed
2016-08-23 15:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fbbbd0d5bd13f0a59455446e0de48dd9a5a4b576 [^]
2016-08-25 10:39 caristu Note Added: 0089380
2016-08-25 10:39 caristu Status resolved => closed
2016-08-25 10:39 caristu Fixed in Version => 3.0PR16Q4
2016-10-14 09:19 alostale Assigned To platform => shuehner
2017-05-03 14:07 alostale Relationship added blocks 0035729


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker