Openbravo Issue Tracking System - POS2
View Issue Details
0053491POS2POSpublic2023-09-19 13:452023-10-31 17:31
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
24Q1 
No
0053491: Generation of small keymaps is very slow when there are many products in the masterdata
A common use case for clients could be to have many products in the masterdata, but just a few of them as part of the keymap. All products would be scannable an searchable, but only a few of them would be available in the keymap, those that are used more often.

Generating the keymap configuration with those volumes (many products, but very few in keymap) seems to be unnecessarily slow. For instance, the keymap included in pos2 sampledata is taking 0000176:0000040 seconds to be generated.
- Add 100.000 products and configure them to be used in the POS (you can use the attached patch)
- Add some code to measure how long the generation of the keymap takes (see other attached patch)
- Log in. Look for the "Generating the keymap took" message, note that it takes very long.
No tags attached.
causes defect 0054361 closed AugustoMauch Keymap- Unable to do login if product is not in the Assorment and the price list of a store 
Issue History
2023-09-19 13:45AugustoMauchNew Issue
2023-09-19 13:45AugustoMauchAssigned To => Retail
2023-09-19 13:45AugustoMauchTriggers an Emergency Pack => No
2023-09-19 13:45AugustoMauchAssigned ToRetail => AugustoMauch
2023-09-19 13:45AugustoMauchStatusnew => scheduled
2023-09-19 14:48hgbotNote Added: 0154994
2023-10-31 17:31hgbotNote Added: 0156574
2023-10-31 17:31hgbotResolutionopen => fixed
2023-10-31 17:31hgbotStatusscheduled => closed
2023-10-31 17:31hgbotFixed in Version => 24Q1
2023-10-31 17:31hgbotNote Added: 0156575
2024-01-16 14:24AugustoMauchRelationship addedcauses 0054022
2024-01-16 14:44AugustoMauchRelationship deletedcauses 0054022
2024-01-16 14:44AugustoMauchRelationship addedcauses 0054361

Notes
(0154994)
hgbot   
2023-09-19 14:48   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2094 [^]
(0156574)
hgbot   
2023-10-31 17:31   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2094 [^]
(0156575)
hgbot   
2023-10-31 17:31   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: afeb827459f6f1d4ac07e8d35e9b6ec4e9313b5b
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 31-10-2023 16:31:42
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/afeb827459f6f1d4ac07e8d35e9b6ec4e9313b5b [^]

Fixes ISSUE-53491: Updates two criterias to improve performance of keymap generation

There were two criterias that, the way they were being built, resulted in very slow executions, that went over all the product
records one by one, the criteria then being executed in-memory for all those records.

The updated criterias take advantage of the existing indexes, and only do the in-memory filter after having already extracted
the relevant records using an index of the model.

---
M web-jspack/org.openbravo.pos2/src/components/KeyMapEditor/steps/KeyMapEditorKeymapsGrid/__test__/KeyMapEditorKeymapsGrid.test.jsx
M web-jspack/org.openbravo.pos2/src/configurations/keymapConfiguration/__test__/getKeymapInformation.test.js
M web-jspack/org.openbravo.pos2/src/configurations/keymapConfiguration/loadKeymapConfigurations.js
M web-jspack/org.openbravo.pos2/src/configurations/keymapConfiguration/utils/getAssortmentProducts.js
---