This project is archived and is in readonly mode.
ActiveSupport::TimeWithZone in Range performance bug
Reported by Bogdan Gusiev | May 13th, 2011 @ 08:28 AM
We discovered that some operations on the Range class of ActiveSupport::TimeWithZone is slow.
Example:
(10.days.ago..3.days.ago).min
Will have more than 5 seconds execution time with both Rails
2.3.11 and 3.0.7 on Ruby 1.8.7.
The problem don't appear on Ruby 1.9.2.
Also the following code doesn't have performance issue:
(10.days.ago.to_datetime..3.days.ago.to_datetime).min
Thanks,
Bogdan
Comments and changes to this ticket
-
nmunson May 14th, 2011 @ 06:03 AM
I can confirm it happens on Ruby 1.8.7 and Rails 3.0.0, the example line takes 10+ seconds to run. The "doesn't have an issue" code works instantly as it did for you as well.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>