I recently did a batch-processing operation, which simulated a calculation 
with roughly 80'000 ActiveRecord objects. Since it was just a simulation 
none of the records were actually persisted to the database. The 
performance of the operation was pretty bad and I investigated a bit. I 
could resolve most of the performance issues by replacing the use of 
ActiveRecord setters with instance variables. I was a bit confused though 
that AR-setters have such a huge impact on performance. I created a gist 
with a test-case that replicated my 
findings: https://gist.github.com/3965012

I don't know the ActiveRecord source that well and wanted to ask what the 
primary reason for the bad performance is. Is there a way to optimize it?

Cheers,
-- Yves

-- 
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/-/jRICuERsao0J.
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.

Reply via email to