Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Lazily load datepicker popup on open/focus #2026

Closed
wants to merge 4 commits into from

Conversation

minhtule
Copy link

@minhtule minhtule commented Apr 7, 2014

This lazy loading is to reduce memory usage especially when datepicker popup is used in a ng-repeat element.

When loading 400 datepickerPopup elements (200 rows x 2 per row), it takes up 450Mb on Chrome 33 (OSX 10.9.2) and also 10+ seconds to load the page.

@bekos
Copy link
Contributor

bekos commented Apr 9, 2014

@minhtule Thx for you PR, but this will be solved when #1915 will land.

@bekos bekos closed this Apr 9, 2014
@tedeh
Copy link

tedeh commented Jun 20, 2014

This is NOT solved by #1915. Heap allocations over time in #1915:
bootstrap-datepicker-heap

Heap allocations over time in #2026:
bootstrap-datepicker-heap-2026

This is achieved by repeatedly cycling between two different pages with two datepicker directives in them. The not-at-the-end spikes are supposed to be gray, by the way.

Any app/tab using datepicker is guaranteed to be rendered useless over time. I use up to six instances of datepicker that are rerendered from time to time and the memory usage of the browser tab shoots up to the hundreds of megabytes after a few "cycles".

Unfortunately, this pull request breaks the tests for me (even if the actual datepicker seems to work as it should which it does not do in #1915) so I'm not sure it should be merged as-is anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants