> It's not often I nitpick in the sake of 'supreme optimization' but in
> this case it's necessary. I'm using the following code snippet to
> generate CSV file for different queries. The process is usually quite
> memory intensive, wondering if anyone with fresh pair of eyes can point
> out any items that can be done differently. Speed is not so much an
> issue, it's quite fast...but for larger recordsets it eats mega RAM.
>
I don't really see much you can do about the memory issues, but there
is certainly optimization potential that could result in less memory
overhead. The two big issues you have is looping over a list and using
Evaluate(). Below is some modified code that may help you.

<cfset columns = ListToArray(results.ColumnList)>
<cfloop query="results">
<cfloop index="x" from="1" to="#ArrayLen(columns)#">
<cfoutput>"#Replace(results[columns[x]], '"', ' ' , 'ALL'
)#"</cfoutput>
</cfloop>
<cfoutput>#Chr(10)#</cfoutput>
</cfloop>

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com

(888) 408-0900 x901

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to