开发者

Rails 2.3/3.1 TimeZone calculation/parsing performace gap

开发者 https://www.devze.com 2023-04-10 16:33 出处:网络
Why does this code 500.times { Time.now.in_time_zone(\'Helsinki\') } take several seconds with Rails 3.1 while it takes only a split second in Rails 2.3 (both with Ruby 1.9.2-p290)?

Why does this code

500.times { Time.now.in_time_zone('Helsinki') }

take several seconds with Rails 3.1 while it takes only a split second in Rails 2.3 (both with Ruby 1.9.2-p290)?

I discovered this by searching for a cause for an extremely slow loading page开发者_JS百科 after upgrading from Rails 2.3 to 3.1.

Any ideas? Also, how to fix it? Haven't found a workaround yet.


Okay, this was an issue in TZInfo and has been fixed now in the Rails 3.1.1

0

精彩评论

暂无评论...
验证码 换一张
取 消