Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: performance issue in tz plugin #2753

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

ikeyan
Copy link

@ikeyan ikeyan commented Oct 20, 2024

In this PR, I have improved the performance of the timezone plugin.
I didn't adopt the previous PR #2019 because it contained a breaking change and it introduced a bug.
I also shrunk the tz plugin after gzip from 1110bytes to 991bytes.

The changes are summarized below:

  • getDateTimeFormat
    • Use hourCycle: 'h23' so we can use single DateTimeFormat options and remove this workaround
    • Set all parts to numeric
  • tzToFirstOffsetCache
    • first guess of timezone offset in fixOffset (moved from here)
  • change code to make it more compressible

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant