3 ms·
maybe because i've time-profiled it? maybe because i've calculated the time it took to instantiate a new AR object for every new db record? maybe because the re
by keiretsu 19y ago
maybe because i've time-profiled it?
maybe because i've calculated the time it took to instantiate a new AR object for every new db record?
maybe because the results show that the AR component took the largest portion of the page loading time?
- ricardo 19y agoYour original post doesn't mention any of this. I think it would help everyone understand your point a lot better if you posted a few specifics...
- tx 19y agoNow we are talking. If I were you, I'd try to look at the bigger picture: do all your pages exhibit this behavior? I bet only few of them do. If ActiveRecord object creation time is your bottleneck, your rhtml on those pages must be very-very thin, because typically rhtml render works waaaay slower than active record. This tells me that you have pages with very little rhtml in them, but they (somehow) require many DB-mapped objects. Sounds like an anomaly to me. But perhaps this is just a nature of your app, in that case dump the slowest objects and don't use ActiveRecord for them. Another good suggestion was already mentioned few posts back: when creating your objects, load only those attributes that matter. Good luck, and hope you'll resolve your performance issues.