bad performance on multiple mode
when mode: 'multiple' and you select large range of dates the more dates selected the bad the performance are..
and the more calendars are the better it gets
it can take 1.2 seconds for select to happen when there are 800 dates selected
see this screenshot from TimeLine tab

the main slowdowns are in is_year_selected and is_months_selected and in the function who called them which also get run multiple times
they get called multiple times per each click when each iteration can take 10ms on desktop
I didn't make any performance testing since I didn't really notice any issues. I believe you that selecting 800 dates (which are all shown at the same time) might hurt performance a lot, but this is honestly not a very common use case. Still, feel free to open PR as better performance is always a good thing to have.
@nazar-pc I am still unfamiliar with the whole code so maybe I will need a hint
I think that the fastest easiest solution would be to catch the results of is_year_selected , is_months_selected
and to invalidate the cache on dates changes
1.where is the best place to listen when date as been changes\added\something new happened?
2.what is the purpose of the function in line 463? I think we can give this function a name and split it to multiple tasks? as it look like it doing multiple things(not 100% sure) 60% time get spends in this function
Yes, this is kind of what I thought as well, simple caching will allow us to radically reduce number of calls to those functions.
- I don't think you need to listen for this and invalidate cache, instead you might cache results for every
fill()call locally in that function (all calendars are rendered inside inforloop) since nothing will change until we exit it current_monthis used in order to determine and add different class to the days on calendar that do not belong to months being shown (like first and last few days rendered)
I didn't dig deeper, will try to do so soon and walk through all open issues as I do from time to time.