You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DatePicker-Overlay opens very slow with large DOM [2 days] #8167
When using the DatePicker on a Page with large and complex DOM, the overlay gets really slow. It opens and then takes multiple seconds to display most of its content.
The shared demo code attempts to create 50 000 layouts, which does not sound realistic. And actually on my computer the page wont even open. So I think better demo is required. When I reduced the number of layouts to 15 000 page opens and DatePicker opens a bit slowly, but not as slow as in video. The slowness in 15 000 layout scenario is expected and not even bad. I would assume that the real view in the video has considerably less elements than 15 000. So a bit better demo case that replicates the actual trigger for the poor performance would help us a lot to investigate.
So we tried to make it comprehensible cause our layout is a bit more complex and has a lot of flex-layouts and so on.
In our application it looks like this:
So we tried to make it comprehensible cause our layout is a bit more complex and has a lot of flex-layouts and so on.
In our application it looks like this:
If each line on that form is FlexLayout, there is only 7 and total number of elements in your view is around hundred, not 50 000 like in the demo code. The demo code is about something totally different than your actual case.
When opening the json file in https://www.speedscope.app/ it looks like the sloweness is distributed over several different JS calls, no single bottleneck. Was that recording made the demo code you shared or the real application?
The lines set active and above, up until _onOverlayOpened are indeed part of the date-picker overlay content.
Is there any custom CSS that you apply to the date-picker overlay or any of its parts in your application?
We were able to solve the problem. The cause of the long loading time was a few global CSS selectors (CSS Universal (*) and :has selectors), which multiplied with the "Recalculate Styles" after the _isVisible call (marked in the image). Nevertheless, an analysis of the many _isVisible calls would be useful. These calls can also be reproduced in a base gradle starter. To do this, simply add a date picker to the view and open it.
Here is the relevant logic of _isVisible() and its invocation in _createPool(). The logic of vaadin-infinite-scroller hasn't really changed lately. We could try to investigate this further to see if there is some room for improvement.
changed the title [-]DatePicker-Overlay opens very slow with large DOM[/-][+]DatePicker-Overlay opens very slow with large DOM [2 days][/+]on Oct 22, 2025
In V14 version of the date-picker, we used to have extra setTimeout() calls around some invocations - example.
IIRC, originally this was done to deal with IE11 and polyfills, but it might be worth checking if restoring that helps.
Activity
TatuLund commentedon Oct 20, 2025
I couldn't import the recording with Chorme.
The shared demo code attempts to create 50 000 layouts, which does not sound realistic. And actually on my computer the page wont even open. So I think better demo is required. When I reduced the number of layouts to 15 000 page opens and DatePicker opens a bit slowly, but not as slow as in video. The slowness in 15 000 layout scenario is expected and not even bad. I would assume that the real view in the video has considerably less elements than 15 000. So a bit better demo case that replicates the actual trigger for the poor performance would help us a lot to investigate.
subITCSS commentedon Oct 20, 2025
So we tried to make it comprehensible cause our layout is a bit more complex and has a lot of flex-layouts and so on.
In our application it looks like this:
Issue_DatePickerOverlay.mp4
TatuLund commentedon Oct 20, 2025
If each line on that form is FlexLayout, there is only 7 and total number of elements in your view is around hundred, not 50 000 like in the demo code. The demo code is about something totally different than your actual case.
TatuLund commentedon Oct 20, 2025
When opening the json file in https://www.speedscope.app/ it looks like the sloweness is distributed over several different JS calls, no single bottleneck. Was that recording made the demo code you shared or the real application?
subITCSS commentedon Oct 20, 2025
I dont have that information but my guess is it is based on the base-gradle - the colleague who made this is recording on vacation this week.
web-padawan commentedon Oct 20, 2025
The lines
set activeand above, up until_onOverlayOpenedare indeed part of the date-picker overlay content.Is there any custom CSS that you apply to the date-picker overlay or any of its parts in your application?
subITCSS commentedon Oct 20, 2025
Yes we have custom/additional styles for that - but i dont think these are heavy.
Custom JS is not applied.
For the vaadin-month-calendar we have these overrides:
and for the vaadin-date-picker we have the following overrides:
nicofri-css commentedon Oct 20, 2025
We were able to solve the problem. The cause of the long loading time was a few global CSS selectors (CSS Universal (*) and :has selectors), which multiplied with the "Recalculate Styles" after the _isVisible call (marked in the image). Nevertheless, an analysis of the many _isVisible calls would be useful. These calls can also be reproduced in a base gradle starter. To do this, simply add a date picker to the view and open it.
web-padawan commentedon Oct 20, 2025
Here is the relevant logic of
_isVisible()and its invocation in_createPool(). The logic ofvaadin-infinite-scrollerhasn't really changed lately. We could try to investigate this further to see if there is some room for improvement.jouni commentedon Oct 22, 2025
I’ve been noticing similar slowness in the Aura dev/demo page: https://vaadin.github.io/web-components/aura.html
Screen.Recording.2025-10-22.at.11.28.45.mov
Could definitely be faster to render.
[-]DatePicker-Overlay opens very slow with large DOM[/-][+]DatePicker-Overlay opens very slow with large DOM [2 days][/+]web-padawan commentedon Oct 22, 2025
In V14 version of the date-picker, we used to have extra
setTimeout()calls around some invocations - example.IIRC, originally this was done to deal with IE11 and polyfills, but it might be worth checking if restoring that helps.
refactor: avoid layout thrashing on first dropdown render (#10380) (C…