-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pickers] Improve open action performance #4602
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Just in case others are reading this: Do not extrapolate from dev to prod. And in general: Do not meassure in development.
These are not expensive because of their performance. Current results for opening a picker by keypress: We can definitely improve the performance and there are some "easy" wins within reach. But let's be accurate in our measurements so that we can make lasting changes. Not measuring did lead to some unnecessary work. |
This issue is very old and did not get a lot of feedback. |
Need to refresh the current condition of pickers' performance before identifying if any work is still needed. |
Why it matters
Opening the date picker on desktop and mobile have a perceptible delay, it's even more noticeable with the range picker. As a UI library, we have a 100ms delay budget before the users start to notice.
The problem
On this demo https://mui.com/x/react-date-pickers/date-picker/#basic-usage, the pickers take about 227ms to show with an x4 throttle (to simulate a regular Windows laptop). The lag can be felt.
Compared with these, they two also have the advantage of triggering on mouse-down which saves ~80ms
I suspect that part of the root cause is that we use too many Material UI primitives (not fast enough), we could instead style from the theme directly.
2020 exploration on the problem
Regarding delivering on better runtime performance
ButtonBase
for the days, I suspect an easy win by replacing them with a simple<button>
, it seems to be an obvious win, we don't need the ripple there.For instance, in dev mode, we get from 400ms to 250ms with this diff:
div > div > button
withbutton
we reduce the runtime from 250ms to 220ms.I believe we could do the same with the year picker.
div > h6
seems wasteful (as well as breaking the accessibility rule of headers continuity. It should bediv > div
at the very least, and ideally onlydiv
.Environment
v6.11.1
The text was updated successfully, but these errors were encountered: