I''m trying to track down why Rails 4.1.0 beta is more than twice as
slow as
Rails 3.2.13 when performing a standard MyModel.includes(:some_association)
query. I''ve already patched an issue that caused it to be 31 times
slower,
(see https://github.com/rails/rails/pull/12090), but the remaining delta is
still prohibitively slow (at least for our app). I''m testing by running
the
following code (see https://gist.github.com/njakobsen/6393783 for a simple
test suite).
RubyProf.start
Item.includes(:people).limit(1000).order(:id).to_a
result = RubyProf.stop
printer = RubyProf::GraphHtmlPrinter.new(result)
printer.print(File.open("../rails-include-performance-#{Rails.version}.html",
''w''))
One interesting thing I noticed using Ruby prof was that while Rails 3.2.13
made 10145 calls to Class#new, Rails 4.1.0 beta called it 67154 times while
running the same test. Now, I''m not familiar with all the fundamental
differences between Rails 3 vs Rails 4, but it seems like we''re now
making
a ton more objects, and it''s having a serious impact on performance. Is
there anyone familiar with the association preloader function, or someone
who is working on performance tuning Rails 4 so I can help make it as fast
as Rails 3 was?
Nicholas.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.