Don't forget to turn off debugging (or remove the 127.0.0.1 ip) 

-mark
 


Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2008 10:19 AM
To: CF-Talk
Subject: Re: CSV Generation MEMORY SUCK

On Mon, Jun 2, 2008 at 10:50 AM, Gaulin, Mark <[EMAIL PROTECTED]>
wrote:

>
> Also, test you page with the user's query but with the output part 
> (actually writing the file) commented out... If the page is still slow 
> and a huge memory hog then the file stuff above won't help much and 
> you'll have to look at running the query in java too, but I but you'll 
> get something by handling the file better.
>

 I honestly don't think it's the file writing that's the problem.

I just commented out the fileWrite() statements inside the <cfloop> tags
that would write each line to the file, (the file still being opened with
the "header" row being written to it... and it made zero difference at all
in the length of time it took to complete.

The query itself runs quite fast.  Returns a lot of rows but isn't a complex
query.

Anyway, I put some cfoutput statements in my gateway (I'm calling it as a
direct cfc call not a gateway for testing).. output now().gettime() to see
the ms as the method call progresses.

The query returns its results in less than 4 seconds.  The process of
generating the csv (around line 330-340 of the sample code I posted earlier)
took 62 of the 68 seconds.

And that was without actually WRITING the file.

the GOOD news is that a TAB delimited file takes considerably less time (32
seconds vs. 68 seconds), cutting the "output time" from 62 seconds to 26
seconds.  Which means the csvFormat() function is taking up a very large
part of the processing time.

This is my csvFormat() function:

<cffunction name="csvFormat" output="false" access="public"
returnType="string">
 <cfargument name="str" type="string" required="yes">  <cfif arguments.str
neq "" and not isNumeric(arguments.str)>
  <cfreturn
"#Chr(34)##replace(arguments.str,chr(34),"#chr(34)##chr(34)#","ALL")##Chr(34
)#">
 <cfelse>
  <cfreturn arguments.str>
 </cfif>
</cffunction>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306628
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to