Skip to content

Use directly TZInfo::Timezone without proxy #18328

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

Merged
merged 1 commit into from
Jan 4, 2015

Conversation

brainopia
Copy link
Contributor

Use directly TZInfo::Timezone without proxy since real timezone is loaded anyway in #utc_offset which is called during #create.

The purpose of TZInfo::TimezoneProxy was to offload parsing tzinfo to improve startup time.
But it was defeated by calling #utc_offset on creation of AS::TimeZone instance.
This is why the time to run AS::TimeZone.all has not changed after this PR.

Also there was an edge-case when AS::TimeZone instance could have been created with bogus timezone if utc_offset was provided. But this would break almost any other method since a lot of them depend on real TZInfo::Timezone instance.

Since real timezone is loaded anyway in `#utc_offset`
which is called during `#create`
rafaelfranca added a commit that referenced this pull request Jan 4, 2015
Use directly TZInfo::Timezone without proxy
@rafaelfranca rafaelfranca merged commit 9644cdc into rails:master Jan 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants