nasa-gibs/worldview

Investigate layer creation / date range determination performance

jasontk19 opened this issue · 1 comments

Each time the currently visible date is changed, we build an OpenLayers LayerGroup object for each active layer which consists of three individual OpenLayers LayerTile objects (current, previous, and next for map wings). For each LayerTile object created we do a bunch of date and date range calculation to determine what dates are available and what can be selected. Near the bottom of the callstack for these calculations is modules/layers/utils:getDayDateRange. A brief investigation of a single call to this function showed a for loop getDayDateRange:507 that iterated nearly 8000 times, creating new JS Date objects and calling additional functions on each iteration which seems like a possible bottleneck. Further investigation is needed.

Screen Shot 2021-08-06 at 11 08 27 AM
Screen Shot 2021-08-06 at 10 56 22 AM

Moved to WV-1984