Join GitHub today
HashWithIndifferentAccess#initialize performance improvement #34642
Rails 4 -> Rails 5 introduced a #to_hash call in HashWithIndifferentAccess#initialize. I am assuming that the intention of this
This commit bypasses this #to_hash call if it is already a Hash, giving a performance boost to the copy constructor of huge HWIAs.
Yeah, here's a quick/dirty benchmark program for it:
I get the following output: