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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033606
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-08-02 18:302016-12-16 18:39
ReportershuehnerView Statuspublic 
Assigned ToNaroaIriarte 
PriorityhighResolutionfixedFixed in Version3.0PR17Q1
StatusclosedFix in branchFixed in SCM revision1f58fdc92474
ProjectionnoneETAnoneTarget Version3.0PR17Q1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033606: speedup Preferences.getAllPreferences by improving getPreferenceFromList functions to do early return

DescriptionThat function does a manually coded complicate list search.

However most entries in that list will be for different properties and not just different in visibility.

So doing early check & return of the properties part in the comparison can save some cpu cycles.

On testing with bigger db that shaves of 50-60ms of all runtime on getAllPreferences.

From around 120ms (of the loop in getAllPreferences) downto 60ms

Note using a Map here instead of list with a key matching the open coded list search could give another speedup
Steps To Reproduce-
TagsPerformance
Attached Filesdiff file icon 33606_prototype.diff [^] (865 bytes) 2016-08-02 18:30 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0092157)
hgbot (developer)
2016-12-07 09:24

Repository: erp/devel/pi
Changeset: 1f58fdc924744f4b1b3ae4d06365a88406f77890
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon Dec 05 15:36:48 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1f58fdc924744f4b1b3ae4d06365a88406f77890 [^]

Fixed issue 33606: The Preferences.getPreferenceFromList improved.

A continue has been added to do an early return in a for loop of the Preferences.getPreferenceFromList method. Putting this code there prevents a lot of executions needed to get the "winVisibilityNotDefined" and the "sameWinVisibility" variables.
The "isCurrentPreference" variable needs to be true to make this piece of code true: "if (isCurrentPreference && (winVisbilityNotDefined || sameWinVisibility)) {" and to return the listPref value. So, if the "isCurrentPreference" is false, it doesn't matter the values of the "winVisibilityNotDefined" nor "sameWinVisibility" values. That is why is a good idea to put the early return. In this way a lot of executions to get the variables will be avoided.

---
M src/org/openbravo/erpCommon/businessUtility/Preferences.java
---
(0092308)
alostale (manager)
2016-12-13 11:22

code reviewed

tested:
* speed is improved accordingly to what was expected
* the preferences returned are the same as before the fix
(0092691)
hudsonbot (developer)
2016-12-16 18:39

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/dc8bf00badd0 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-08-02 18:30 shuehner New Issue
2016-08-02 18:30 shuehner Assigned To => platform
2016-08-02 18:30 shuehner Modules => Core
2016-08-02 18:30 shuehner Triggers an Emergency Pack => No
2016-08-02 18:30 shuehner Tag Attached: Performance
2016-08-02 18:30 shuehner File Added: 33606_prototype.diff
2016-09-29 09:10 alostale Status new => acknowledged
2016-09-29 09:10 alostale Target Version => 3.0PR17Q1
2016-12-01 14:05 alostale Priority normal => urgent
2016-12-01 14:05 alostale Priority urgent => high
2016-12-05 12:48 NaroaIriarte Assigned To platform => NaroaIriarte
2016-12-05 14:58 NaroaIriarte Status acknowledged => scheduled
2016-12-07 09:24 hgbot Checkin
2016-12-07 09:24 hgbot Note Added: 0092157
2016-12-07 09:24 hgbot Status scheduled => resolved
2016-12-07 09:24 hgbot Resolution open => fixed
2016-12-07 09:24 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f58fdc924744f4b1b3ae4d06365a88406f77890 [^]
2016-12-07 09:26 NaroaIriarte Review Assigned To => alostale
2016-12-13 11:22 alostale Note Added: 0092308
2016-12-13 11:22 alostale Status resolved => closed
2016-12-13 11:22 alostale Fixed in Version => 3.0PR17Q1
2016-12-16 18:39 hudsonbot Checkin
2016-12-16 18:39 hudsonbot Note Added: 0092691


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker