-
Notifications
You must be signed in to change notification settings - Fork 730
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
Improve IANAZone.offset performance #1503
base: master
Are you sure you want to change the base?
Conversation
d8f8f69
to
203a219
Compare
The problem with this is that the output format of |
@diesieben07 This problem exists for |
|
203a219
to
b7a95c2
Compare
I've added this. I also extracted the offset calculations out of the method, and made each function get its own DTF since they rely on different formats. The check is expensive, that's why I had to do it inside the |
In general, I like this kind of optimization, as long as the feature detection works well. For partsOffset and even Intl support in general, we went through years of feature detection and updates to the support matrix as support stabilized and we bumped the minimum browser version up to support them. And then we left hackyOffset in there as a fallback to I'm also somewhat hoping there's a better way to detect support for |
I found this issue while investigating a performance issue in offset that impacted a use case of parsing a few hundred thousand dates at a time. I noticed that
It seems like there might be good reasons not to enable this in the browser, but I am very tempted to use this approach in node where I control the environment... |
Any update on this? I've been using it in production since and it seems to be working well. Note that this is even faster than |
This is more than 2.5x faster in my testing. Example benchmark script: