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

Already on GitHub? Sign in to your account

Make sure require_tzinfo only calls Kernel#require if TZInfo isn't alread #2911

Merged
merged 1 commit into from Sep 7, 2011

Conversation

Projects
None yet
2 participants
Contributor

toolmantim commented Sep 7, 2011

Make sure require_tzinfo only calls Kernel#require if TZInfo isn't already present.

This wasn't a problem when require_tzinfo was only called from TimeZone#initialize, but now it's being called for every lookup to TimeZone.[](via lazy_zones_map)

TimeZone lookup can occur when unmarshalling TimeWithZone objects, which is where I first saw the big slowdown (500ms for each Rails action that loaded from Rails.cache)

https://gist.github.com/1200301

This should probably be applied to rails-3-1-stable as well.

@toolmantim toolmantim Make sure require_tzinfo only calls Kernel#require if TZInfo isn't al…
…ready present.


This wasn't a problem when require_tzinfo was only called from TimeZone#initialize, but now it's being called for every lookup to TimeZone.[] (via lazy_zones_map)

TimeZone lookup can occur when unmarshalling TimeWithZone objects, which is where I first saw the big slowdown (500ms for each Rails action that loaded from Rails.cache)
2147f35

@jonleighton jonleighton added a commit that referenced this pull request Sep 7, 2011

@jonleighton jonleighton Merge pull request #2911 from toolmantim/patch-1
Make sure require_tzinfo only calls Kernel#require if TZInfo isn't alread
fb5dbe8

@jonleighton jonleighton merged commit fb5dbe8 into rails:master Sep 7, 2011

Member

jonleighton commented Sep 7, 2011

Crap, that's a bad bug :(

Would you mind doing a pull request for 3-1-stable also, and include an entry in the CHANGELOG? Thanks.

Contributor

toolmantim commented Sep 7, 2011

Coming up!

Contributor

toolmantim commented Sep 7, 2011

Against 3-1-stable: #2913

What'st the story with updating the master branch's changelog? I don't see any other 3-1-1 logs in there.

Member

jonleighton commented Sep 7, 2011

For now we doing the 3.1.1 changelog just in 3-1-stable, maybe it will be merged back to master in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment