Re: Improving Performance

2011-08-18 Thread Larry Lyons
I wouldn't use string concatenation, that's very slow. Rather I'd use cfsavecontent surrounding the outermost loop and then write those results to file once rather than with each iteration of the lop. FileIO can be the slowest part of this whole thing. Just with those two changes you should s

RE: Improving Performance

2011-08-18 Thread Mark A. Kruger
To: cf-talk Subject: Re: Improving Performance so, I got two suggestions from this thread that proved worthy.. #1 - someone asked about the need for the .toString() call - apparently, I don't actually need this. I ran some tests without it and it worked and speed things up. #2 - So

Re: Improving Performance

2011-08-18 Thread Russ Michaels
super, glad it helped :-) On Thu, Aug 18, 2011 at 4:41 PM, Rick Root wrote: > > so, I got two suggestions from this thread that proved worthy.. > > #1 - someone asked about the need for the .toString() call - apparently, I > don't actually need this. I ran some tests without it and it worked a

Re: Improving Performance

2011-08-18 Thread Rick Root
so, I got two suggestions from this thread that proved worthy.. #1 - someone asked about the need for the .toString() call - apparently, I don't actually need this. I ran some tests without it and it worked and speed things up. #2 - Someone suggested writing the whole record instead of one fi

Re: Improving Performance

2011-08-18 Thread Russ Michaels
so why not try just cfloop over the query normally and output only the columns you want #column1# #columns2# etc... On Thu, Aug 18, 2011 at 3:39 PM, Rick Root wrote: > > >does the original data need to be a 2 dimensional array or can you > generate > >it as q uery, then you only have 1 loop

Re: Improving Performance

2011-08-18 Thread Roger Austin
Rick Root 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)

RE: Improving Performance

2011-08-18 Thread Mark A. Kruger
9:11 AM To: cf-talk Subject: Re: Improving Performance oops.. 180 columns, not 1800 =) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive

Re: Improving Performance

2011-08-18 Thread Rick Root
>do you really need to perform the ToString() function ? > Yes, since sometimes the data in the query is NOT a "string object" .. it is sometimes a date, and coldfusion will try to pass it in as a date, and since CsvWriter is java, and expects a string, it doesn't like getting date objects =)

Re: Improving Performance

2011-08-18 Thread Rick Root
>does the original data need to be a 2 dimensional array or can you generate >it as q uery, then you only have 1 loop. It actually is a query - however the query contains fields that aren't necessarily going to be in the output file. There wouldn't necessarily have to be an inside loop but the

Re: Improving Performance

2011-08-18 Thread Russ Michaels
does the original data need to be a 2 dimensional array or can you generate it as q uery, then you only have 1 loop. On Thu, Aug 18, 2011 at 2:50 PM, Rick Root wrote: > > Can anyone suggest ways that might incrementally improve the performance of > this code? > > I'm using the JavaCSV library t

Re: Improving Performance

2011-08-18 Thread Russ Michaels
do you really need to perform the ToString() function ? On Thu, Aug 18, 2011 at 3:06 PM, Rick Root wrote: > > Well, I think the JavaCSV method is pretty fast. What I'm wondering is if > there's a better way to do this line: > > resultSet[fieldsArray[i]][resultSet.currentRow].toString() )> > >

Re: Improving Performance

2011-08-18 Thread Rick Root
oops.. 180 columns, not 1800 =) ~| 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/mes

Re: Improving Performance

2011-08-18 Thread Rick Root
> Well, I think the JavaCSV method is pretty fast. What I'm wondering > is if there's a better way to do this line: > > resultSet[fieldsArray[i]][resultSet.currentRow].toString() )> And I mean in terms of evaluating the field resultSet[fieldsArray[i]][resultSet.currentRow] Like, maybe if I

RE: Improving Performance

2011-08-18 Thread Mark A. Kruger
Rick, Wow... 1,800 columns is a lot... 50k rows not so much. But together you end up with 90 million total loop iterations (50k outer loop times 1.8k inner loop). That's a bit excessive :). Sine you are writing to the file with each inner loop iteration (each column value in effect) you are appen

Re: Improving Performance

2011-08-18 Thread Rick Root
Well, I think the JavaCSV method is pretty fast. What I'm wondering is if there's a better way to do this line: Let's say you improve the speed of that line by 0.1ms ... that improves a 50,000 row 100 column generation by 500 secnds. This is part of a dynamic report generation tool, run by

Re: Improving Performance

2011-08-18 Thread Russ Michaels
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 t