-
-
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
Performance problem: slow format() #2400
Comments
this pull request solves the problem #2313 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
This takes too long, because every call to
.format()
does much of work under the hood:dayjs/src/index.js
Lines 262 to 342 in a9d7d03
The worst things performance-wise:
getShort
,get$H
,meridiemFunc
,matches
are created on every call, even if not neededD MMMM YYYY
is processed viastr.replace(C.REGEX_FORMAT, ...)
again and again on every callExpected behavior
I'd like to have a way to preprocess/precompile format string in such a way that the following calls to
format()
will be very fast. E.g.Information
The text was updated successfully, but these errors were encountered: