Preface: We are working hard to upgrade our apps Ruby and Rails versions, but need to work with what we're on at the moment.
We have functionality to export data to CSV in our RoR app.
We recently upgraded to Ruby 1.8.7, Rails 3.1, and the performance of this CSV output slowed incredibly. We're talking about over a minute for ~2000 records, which seems a bit ridiculous.
Also, when a request for this is processing, it basically brings down the server for other requests to this app and others.
I have:
- Upgraded from CSV to the FasterCSV gem (no difference or even slower!)
- Made sure that we are eager-loading everything possible in the AR query
- Verified that it is not query time, but the actual call to FasterCSV to generate the CSV from the AR collection, that is taking vast majority of response time
I'm pretty sure that getting to Ruby 1.9.x and higher Rails versions will allow for better performance, but really need to be able to achieve acceptable response times (<30 seconds, at least) now.
Any help/guidance much appreciated.