-
-
Notifications
You must be signed in to change notification settings - Fork 515
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
Slow performance in formatLongDate #180
Comments
Same here, was doing some performance analysis and realized more than half of my (pretty heavy) app rendering was spent in those functions. @wojtekmaj this looks like those functions are only used for aria purpose, could you confirm? If so, would you be ok to add a prop like @andrepcg for now, dirty but works:
|
I tried to reproduce this and I can confirm that the performance of this function is poor. I'm not sure what we can do about this yet, but will experiment and let you know. @bs85 Yes, at the moment they are used for accessibility purposes. |
I only noticed this slowdown after upgrading our project dependencies last week. No performance slowdown with packages:
Now I'm working with:
|
For my code, I just ignore formatLongDate when there is no locale. // ------------ Day.jsx
<Tile
{...otherProps}
classes={[
...classes,
className,
isWeekend(date, calendarType) ? `${className}--weekend` : null,
neighboringMonth ? `${className}--neighboringMonth` : null,
]}
date={date}
formatAbbr={locale && formatLongDate} |
This comment has been minimized.
This comment has been minimized.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
Okay, I think I've found the issue. Turns out, calling I've created a test page with 10 calendars on it, ran full page render with 6x CPU slowdown, these are the results. Before:
After:
|
I'm noticing that when I open the calendar (it's behind a button click to open) there's a small delay. I've been trying to track the performance using the Chrome Dev Tools and found this (running React on production):
formatLongYear
is taking 116ms which is quite a bit. This happens rendering the Tile component.Has this happened to anyone?
The text was updated successfully, but these errors were encountered: