-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pickers] shouldDisableDate
is called a lot of time for each date
#6787
Comments
What makes this function so slow on your side ? Could you speed it up ? For instance by avoiding linear complexity with object instead of lists to check the availability of a date. Maybe we can improve the amount of calls, but it will probably not solve the root issue if your method takes several ms per date. |
shouldDisableDate
is called a lot of time for each date
Yeah I managed to speed it up with a binary search, plus including In any case this seems like a more process intensive method of doing this. |
For that part I do agree |
It seems as if this is not happening anymore (codesandbox with test here). Any objectiosn closing this @flaviendelangle ? |
If my silly way of testing is to be believed, then yes, it seems to have improved, the callback is being called almost half as much as on |
If it's called less than before, it's nice |
Duplicates
Latest version
Steps to reproduce 馃暪
Current behavior 馃槸
When
avaliableDates
is defined theStaticDatePicker
will callshouldDisableDate
between 5-6 times for everyavaliableDate
(avaliableDate.length * (5.5 +- 0.5)
).shouldDisableDateFunc
takes ~3-5ms to run so that's not where the bottle neck is.With
avaliableDates
having 70 items, theStaticDatePicker
callsshouldDisableDateFunc
430 time (tested with chrome profiler) and takes >1000ms to become visible.Expected behavior 馃
StaticDatePicker
should render in less than 200ms (or as good as instant from the perspective of the user)Context 馃敠
Need to disable dates so that the user won't pick them
Your environment 馃寧
npx @mui/envinfo
Order ID 馃挸 (optional)
No response
The text was updated successfully, but these errors were encountered: