as your are appending to an open file, I would have thought that is the best way, other than doing it all in memory. Here are a few things to try. How about using a database and then exporting the data to a CSV file when you need it. Or how about setting up a CSV file as a datasource and writing to that. And finally, there are some CFX tags around for writing to CSV files, you could give one of them a try.
Russ On Thu, Aug 18, 2011 at 2:50 PM, Rick Root <rick.r...@gmail.com> wrote: > > Can anyone suggest ways that might incrementally improve the performance of > this code? > > I'm using the JavaCSV library to generate a CSV file. It works pretty > well, > but has some difficulty outputting extremely large files (50,000+ records, > 1800 columns or so) > > (formatted pastebin here: http://pastebin.com/zZVAHdPk) > > <cfloop query="resultSet"> > <!--- write record ---> > <cfloop from="1" to="#numFields#" index="i" step="1"> > <cfset fileOutput.write( > resultSet[fieldsArray[i]][resultSet.currentRow].toString() )> > </cfloop> > <!--- write end of record ---> > <cfset fileOutput.endRecord()> > </cfloop> > > Thanks for your suggestions! > > Rick > > -- > *The beatings will continue until morale improves.* > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346823 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm