Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033137 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Retail Modules] Web POS | minor | have not tried | 2016-06-05 14:14 | 2016-06-15 19:12 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | shuehner | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | ff679a972979 | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | marvintm | |||||||
OBNetwork customer | No | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0033137: Useless m_product read from services product even if services are not used | |||||||
Description | The addition of services project with createLinesForServiceProduct and the HashMap orderlineServiceList added a m_product read to OrderLoader which is not required if services are not used. That extra overhead should be at least avoided if services are not used. Relevant code is in createOrderLines: if ("S".equals(orderline.getProduct().getProductType())) { // related can be null if (jsonOrderLine.has("relatedLines")) { orderLineServiceList.put(orderline.getId(), jsonOrderLine.getJSONArray("relatedLines")); The conditions can be swapped around to avoid the getProduct() call if there is no relatedLines in the json. | |||||||
Steps To Reproduce | Trace all SQL of orderloader. | |||||||
Tags | Performance | |||||||
Attached Files | ![]() ![]() | |||||||
![]() |
||||||||
|
![]() |
|
(0087002) shuehner (administrator) 2016-06-05 14:20 |
Patch in 2 parts: a.) Review createLinesForServiceProduct function which only does any real work if the 'value' part of the HashMap is not null. So the else part inside createOrderLines which insert into the HashMap with value=null is useless. 33137_part1.diff cleans up that part to avoid some overhead and simplify the code. b.) Now with the part inside createOrderLines simplified the 2 if conditions can be swapped around which does not trigger getProduct() sql read unless there is really a relatedLines item present in the json. So the read overhead is removed unless services/relatedLines are really used. |
(0087130) hgbot (developer) 2016-06-09 15:48 |
Repository: erp/pmods/org.openbravo.retail.posterminal Changeset: 70c2aca3faa72a1a4535e3ca46e94c481dd9bd2c Author: Stefan Hühner <stefan.huehner <at> openbravo.com> Date: Tue Jun 07 17:19:06 2016 +0200 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/70c2aca3faa72a1a4535e3ca46e94c481dd9bd2c [^] Issue 33137. Simplify code related to createLinesForServiceProduct. The only reader of the HashMap orderLineServiceList only does any processing if the value part of the map is not null. So avoid inserting into the HashMap any entries which have value null as those are not useful (and remove the != null check also) --- M src/org/openbravo/retail/posterminal/OrderLoader.java --- |
(0087131) hgbot (developer) 2016-06-09 15:48 |
Repository: erp/pmods/org.openbravo.retail.posterminal Changeset: ff679a9729794badd242c68064c80efc8c4e1457 Author: Stefan Hühner <stefan.huehner <at> openbravo.com> Date: Tue Jun 07 17:20:39 2016 +0200 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ff679a9729794badd242c68064c80efc8c4e1457 [^] Fixed 33137. Avoid m_product read if not service lines are used. Swap check condition for m_product.getType() == S and if the json has a relatedLines part. By checking json first we avoid the m_product read in the normal case. --- M src/org/openbravo/retail/posterminal/OrderLoader.java --- |
![]() |
|||
Date Modified | Username | Field | Change |
2016-06-05 14:14 | shuehner | New Issue | |
2016-06-05 14:14 | shuehner | Assigned To | => Retail |
2016-06-05 14:14 | shuehner | OBNetwork customer | => No |
2016-06-05 14:14 | shuehner | Triggers an Emergency Pack | => No |
2016-06-05 14:14 | shuehner | Tag Attached: Performance | |
2016-06-05 14:20 | shuehner | Note Added: 0087002 | |
2016-06-05 14:20 | shuehner | File Added: 33137_part1.diff | |
2016-06-05 14:20 | shuehner | File Added: 33137_part2.diff | |
2016-06-07 18:09 | shuehner | Relationship added | related to 0033178 |
2016-06-09 15:48 | hgbot | Checkin | |
2016-06-09 15:48 | hgbot | Note Added: 0087130 | |
2016-06-09 15:48 | hgbot | Checkin | |
2016-06-09 15:48 | hgbot | Note Added: 0087131 | |
2016-06-09 15:48 | hgbot | Status | new => resolved |
2016-06-09 15:48 | hgbot | Resolution | open => fixed |
2016-06-09 15:48 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ff679a9729794badd242c68064c80efc8c4e1457 [^] |
2016-06-09 15:57 | shuehner | Assigned To | Retail => shuehner |
2016-06-09 15:57 | shuehner | Review Assigned To | => marvintm |
2016-06-15 19:12 | marvintm | Status | resolved => closed |
Copyright © 2000 - 2009 MantisBT Group |