Nice! I didn't know this. Thanks for sharing :)
On Jul 15, 2011, at 6:55 AM, Jon Leighton wrote: > If you're on 1.9 there is no slowdown with using OrderedHash vs Hash, as > OrderedHash basically just inherits from Hash and does nothing else. > > https://github.com/rails/rails/blob/master/activesupport/lib/active_support/ordered_hash.rb#L51 > > On Thu, 2011-07-14 at 22:05 -0400, Prem Sichanugrist wrote: >> If your target deployment is Ruby 1.9, you *should* use Hash that come with >> Ruby. It's guaranteed to be sorted, and it doesn't have the same overhead >> that AS::OrderedHash has. >> >> Do you know that AS::OrderedHash is an array within array, and it's very >> slow? Hash in 1.9 is written in C, and doesn't suffer the same slowness. >> >> - Prem >> >> On Jul 14, 2011, at 9:37 PM, Andrew Kaspick wrote: >> >>> Why don't you want to rely on it? It's documented behaviour, so you >>> can totally rely on it. >>> >>> On Thu, Jul 14, 2011 at 5:47 PM, Alexey <[email protected]> wrote: >>>> Hello, i have asked this question here: >>>> https://www.ruby-forum.com/topic/2140803, but maybe you can answer quickly. >>>> Is ActiveSupport::OrderedHash going to be maintained in Rails? >>>> Its API page disappeared. >>>> I do not want to rely on Hash's being ordered in Ruby 1.9 (mainly because >>>> it >>>> is not called OrderedHash). >>>> Thank you, >>>> Alexey. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "Ruby on Rails: Core" group. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msg/rubyonrails-core/-/FsZLFviGct0J. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-core?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Core" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-core?hl=en. >>> >> > > -- > http://jonathanleighton.com/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
