Openbravo Issue Tracking System - Modules
View Issue Details
0039837ModulesResource and Reservation Managementpublic2018-12-19 13:532019-01-08 08:10
caristu 
AtulOpenbravo 
highmajorhave not tried
closedfixed 
5
 
 
Sandrahuguet
0039837: dateIsWorkday function performance should be improved
When the resources calendar is drawn/redrawn, the dateIsWorkDay function[1] function is executed for every calendar cell to determine if they are available or not for entering reservations.

This impacts on the time spent to show/refresh the calendar

[1] https://code.openbravo.com/erp/pmods/org.openbravo.module.resources/file/tip/web/org.openbravo.module.resources/js/calendar/ob-resourcescalendar-widget.js#l1247 [^]
1) Using Chrome's Performance profiler measure the times spent to load the resources and reservation calendar
2) Note that the most part of the time is spent in the dateIsWorkDay function.

Attached are some screenshots of the numbers retrieved with the profiler (when opening the resources calendar from a POS-Terminal).
Performance
png callTree.png (186,523) 2018-12-19 13:54
https://issues.openbravo.com/file_download.php?file_id=12442&type=bug
png

png dateIsWorkDay.png (187,376) 2018-12-19 13:57
https://issues.openbravo.com/file_download.php?file_id=12444&type=bug
png

png dateIsWorkDay2.png (217,241) 2018-12-19 13:57
https://issues.openbravo.com/file_download.php?file_id=12445&type=bug
png
Issue History
2018-12-19 13:53caristuNew Issue
2018-12-19 13:53caristuAssigned To => Triage Finance
2018-12-19 13:53caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18064#r18064
2018-12-19 13:54caristuDescription Updatedbug_revision_view_page.php?rev_id=18066#r18066
2018-12-19 13:54caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18067#r18067
2018-12-19 13:54caristuFile Added: callTree.png
2018-12-19 13:54caristuFile Added: dateIsWorkDay2.png
2018-12-19 13:56caristuDescription Updatedbug_revision_view_page.php?rev_id=18068#r18068
2018-12-19 13:57caristuFile Deleted: dateIsWorkDay2.png
2018-12-19 13:57caristuFile Added: dateIsWorkDay.png
2018-12-19 13:57caristuFile Added: dateIsWorkDay2.png
2018-12-19 17:40dmitry_mezentsevSeverityminor => major
2018-12-19 17:47SandrahuguetTag Attached: Performance
2018-12-24 11:15AtulOpenbravoStatusnew => scheduled
2018-12-27 16:30SandrahuguetAssigned ToTriage Finance => AtulOpenbravo
2019-01-04 08:30hgbotCheckin
2019-01-04 08:30hgbotNote Added: 0108823
2019-01-04 08:30hgbotStatusscheduled => resolved
2019-01-04 08:30hgbotResolutionopen => fixed
2019-01-04 08:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/50b01843cbd7869e8d1a3e76dc4938ce6d1ab384 [^]
2019-01-04 08:30hgbotCheckin
2019-01-04 08:30hgbotNote Added: 0108824
2019-01-04 08:38SandrahuguetReview Assigned To => Sandrahuguet
2019-01-04 08:38SandrahuguetNote Added: 0108825
2019-01-04 08:38SandrahuguetStatusresolved => closed
2019-01-08 08:10hgbotCheckin
2019-01-08 08:10hgbotNote Added: 0108849

Notes
(0108823)
hgbot   
2019-01-04 08:30   
Repository: erp/pmods/org.openbravo.module.resources
Changeset: 50b01843cbd7869e8d1a3e76dc4938ce6d1ab384
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Jan 03 18:32:06 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/50b01843cbd7869e8d1a3e76dc4938ce6d1ab384 [^]

Fixes Issue 39837:dateIsWorkday function performance should
be improved

Calendar Unavailability is fetched for date range in between
2 weeks in past and 4 weeks in the future. In case the date
is in between above range, short Array with less data is
sent to getDateTimeAvailabilityDuration.

---
M src/org/openbravo/module/resources/calendar/ReservationUtilities.java
M src/org/openbravo/module/resources/calendar/ResourcesCalendarActionHandler.java
M web/org.openbravo.module.resources/js/calendar/ob-resourcescalendar-widget.js
---
(0108824)
hgbot   
2019-01-04 08:30   
Repository: erp/pmods/org.openbravo.module.resources
Changeset: f82f8354ebc5f3f689648381630d43227db13863
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Fri Jan 04 08:19:06 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/f82f8354ebc5f3f689648381630d43227db13863 [^]

related to issue 39837 code review changes

*delete unused variable
*improve variable name
*use getFirstDayOfWeek

---
M src/org/openbravo/module/resources/calendar/ReservationUtilities.java
M web/org.openbravo.module.resources/js/calendar/ob-resourcescalendar-widget.js
---
(0108825)
Sandrahuguet   
2019-01-04 08:38   
Code review + testing OK
(0108849)
hgbot   
2019-01-08 08:10   
Repository: erp/pmods/org.openbravo.module.resources
Changeset: 6713158524b0feb5323d7348d5171356779002c0
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Jan 08 08:10:27 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/6713158524b0feb5323d7348d5171356779002c0 [^]

related to issue 39837 fixed jslint error

---
M web/org.openbravo.module.resources/js/calendar/ob-resourcescalendar-widget.js
---