-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix: performance issue in tz plugin #2019
base: dev
Are you sure you want to change the base?
Conversation
Hi @defghy, yes you are correct, but I don't think this is an issue. The dates are the same, just in different formats. The previous code that
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, great fix for the perf issue
Has some problem when date is Invalid Date; In this situation, an Error throw; |
@defghy this actually seems to be an improvement, in my opinion. I think it is OK to throw an error if anything other than a |
@iamkun can you please review this? |
1 similar comment
@iamkun can you please review this? |
up 👍 |
up up up) |
up up ? |
Why haven't there been any updates for this issue? |
Repo looks like dead, the only author doesn't support it. |
up |
Thanks for making such an awesome project @logeyG @iamkun ! I'm hoping to bump this up in your priority list to review as the current state is currently contributing to 2.5% of my nodejs backend application's CPU profile with a wall time of about 162ms. This would be an easy win for improving our applications speed. We've seen tons of performance improvements since switching from moment but this one is definitely an outlier. Thanks again! |
@logeyG This fix is not correct. Try this:
I belive that you have to set hour12 to true. |
@iamkun Bumping this as well. Seeing major performance issues with using the tz plugin as it exists now. The changes proposed in this PR result in orders of magnitude better perf. Happy to help with testing or whatever is needed. Let me know. 🙏 |
Hello guys, firstly I'd like to thank you @iamkun for all for the effort you put into enhancing the dayjs library. I've also encountered some performance challenges related to the timezone function, which have been impacting my work. I came across PR #2542 and noticed that it addresses these issues effectively, as well as this PR. Could you share any insights on the timeline for the next release that would include these significant improvements? This update would greatly benefit our projects, and we're looking forward to integrating it. Thank you for your continued dedication to improving dayjs, we love it. |
For temporary measure, you guys can use my forked library for the timezone issue. I have merged this PR. https://www.npmjs.com/package/@adlanarifzr/dayjs
|
These improvements have significantly enhanced our performance here. Are you/anyone aware of any other functions that might be encountering similar performance issues? |
@iamkun Is it possible for you to review this? It solves a major performance issue with the timezone plugin |
#2753 is an improved version of this PR I made. |
As much as it seem reasonable, it's a breaking change With this version, you can try ANY param, state is always initiated with null-ish values and it just crashes |
This PR is an adaptation of the following closed PR: #1889
The only change I made was to create a default config object that is used for both
getDateTimeFormat
as well asgetLocaleStringifier
.Fixes #1236