Re: [Rails-core] String Allocation and Memory Bloat in ActiveRecord Objects

2015-08-24 Thread alexander . maznev
Hello Richard, Thanks for the response. Unfortunately I'm not sure how it's possible to do this without the Hash look-up. For example one might imagine adding something like this to ActiveSupport::Callbacks (which would prevent more than one string from being permanently allocated): @@_curr

Re: [Rails-core] Re: Always set id from database when creating new record

2015-08-24 Thread Matt Jones
On Fri, Aug 21, 2015 at 2:46 PM, masa331 wrote: > I don't think it would. You set the id in model, it's passed to database, > and then database returns it back again > > Some of the database adapters require an additional round-trip to retrieve the newly-inserted ID; this doesn't happen if an id

[Rails-core] [ANN] Rails 4.2.4 and 4.1.13 have been released!

2015-08-24 Thread Rafael Mendonça França
Hi everyone, I am happy to announce that Rails 4.2.4 and 4.1.13 have been released. No regressions were found so these releases include the same changes that the release candidates. ## CHANGES since 4.1.12 To view the changes for each gem, please read the changelogs on GitHub: * [Action Mailer

Re: [Rails-core] Feature suggestion: Use symbols internally with HashWithIndifferentAccess

2015-08-24 Thread richard schneeman
In 2.2 the speed of symbols and strings are much closer: ``` require 'benchmark/ips' hash = {} Benchmark.ips do |x|   x.report("symbol ") { hash[:symbol] }   x.report("string ") { hash["string"]} end ``` Gives us ``` Calculating -    

Re: [Rails-core] Feature suggestion: Use symbols internally with HashWithIndifferentAccess

2015-08-24 Thread Xavier Noria
On Mon, Aug 24, 2015 at 3:22 AM, Rafael Mendonça França < rafaelmfra...@gmail.com> wrote: > I think we can change but it is a backward incompatible change > In particular, it belongs to the public interface that keys are strings, #keys, #each, etc. are guaranteed to return strings. -- You receiv