Thanks for the reply. I'm not sure about how many objects, but for page (on which we are showing way, way too much information) we do about 5000 SQL queries, a few of which might pull back 100 records or so. I think a lot of those calls could be collapsed with eager loading. But, lets say there are 6000 objects. On my system, I calculated the object construction time (not including SQL time) as being .000031s, which for 6000 objects adds up to 0.186s-- which is not insignificant, though probably not our biggest performance issue.
I took a look at aggregate functions, and I don't think they would be of much use in this case, but thanks for mentioning them because I wasn't aware you could do that. --Paul On Feb 24, 6:05 am, Andy Jeffries <andyjeffr...@gmail.com> wrote: > > My question is, is there a way to cache the ActiveRecord objects as > > well? I have read that their construction is time consuming. > > I think that used to be the case, but I don't think it is any more (which > may be why the Query cache doesn't cache them). Also, how many objects are > you constructing? It should really only be a page worth, otherwise I'd use > aggregate functions (if you're just iterating anyway). > > Cheers, > > Andy -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.