Openbravo Issue Tracking System - POS2
View Issue Details
0052370POS2Corepublic2023-05-06 11:002023-08-02 08:41
AugustoMauch 
ablasco 
normalmajorhave not tried
closedfixed 
5
 
23Q4 
No
0052370: Performance: Keymap buttons are rerendered on scroll
When using the scroll on a keymap, all its buttons are being continually, unnecessarily re-rendered.

See the attached images. One shows a profile log that shows how much cpu-consuming is to scroll a keymap (in the product keymap most of the time is spent on ProductButton.preparePayload).

The other image shows a log that is rendered each time the BaseKeymap or a ProductButton is rerendered. Note that log was also added to ProductKeymap, but that component is not being rerendered on scroll.
No tags attached.
gif KeymapRerender.gif (878,151) 2023-05-06 11:02
https://issues.openbravo.com/file_download.php?file_id=18489&type=bug
png KeymapProfile.png (215,339) 2023-05-06 11:04
https://issues.openbravo.com/file_download.php?file_id=18490&type=bug
png
Issue History
2023-05-06 11:00AugustoMauchNew Issue
2023-05-06 11:00AugustoMauchAssigned To => Triage Platform Base
2023-05-06 11:00AugustoMauchTriggers an Emergency Pack => No
2023-05-06 11:02AugustoMauchFile Added: KeymapRerender.gif
2023-05-06 11:04AugustoMauchFile Added: KeymapProfile.png
2023-06-22 14:04AugustoMauchAssigned ToTriage Platform Base => ablasco
2023-07-21 11:46hgbotNote Added: 0152793
2023-07-26 14:33AugustoMauchStatusnew => scheduled
2023-08-02 08:41hgbotResolutionopen => fixed
2023-08-02 08:41hgbotStatusscheduled => closed
2023-08-02 08:41hgbotNote Added: 0153084
2023-08-02 08:41hgbotFixed in Version => 23Q4
2023-08-02 08:41hgbotNote Added: 0153085

Notes
(0152793)
hgbot   
2023-07-21 11:46   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1181 [^]
(0153084)
hgbot   
2023-08-02 08:41   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1181 [^]
(0153085)
hgbot   
2023-08-02 08:41   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 4d90e236f10f570af164658525451f76141ccd2e
Author: adrian.blasco <adrian.blasco@openbravo.com>
Date: 01-08-2023 15:05:48
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/4d90e236f10f570af164658525451f76141ccd2e [^]

Fixes ISSUE-52370 usePagination memoized and check disable dependency which causes rendering

usePagination should be memoized to avoid rerendering component with its children ( in this case, ProductKeymap which is using BaseKeymap )

Also, the content of the BaseKeymap has been memoized to avoid being rerendered when a BaseKeymap property that is not relevant to it (i.e.
disable, that affects the Carousel subcomponent but not the main BaseKeymap content).

---
M web-jspack/org.openbravo.core2/src/components/BaseKeymap/BaseKeymap.jsx
M web-jspack/org.openbravo.core2/src/components/BaseKeymap/hooks/usePagination.js
---