Well I can tell you right off the bat that this:
<cfloop query ="ProdCatDESC">
<cfoutput query="ProdCatDESC" >
#ProductCategoryDescShort#, #ProductCategoryID#
</cfoutput>
<snip>
</cfloop>
Is not helping. You are asking it to loop over the query and then for every
single iteration of the loop, process the entire query in the cfoutput.
Change it to:
<cfloop query ="ProdCatDESC">
<cfoutput>
#ProductCategoryDescShort#, #ProductCategoryID#<br>
</cfoutput>
And I am willing to bet that you will see a tremendous improvement in
performance.
DC
----- Original Message -----
From: "Kinnikinnick Foods Inc. Info Desk" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, December 19, 2000 17:21
Subject: CFFILE write and processing speed Question
> Hi all...new to list.
>
> Have been messing about with CF for a couple of months now. Currently we
> have a web store running on an old cgi based unix system. It works well
and
> I'm not changing it until I have a much better handle on CF but I am using
> CF to generate all of our static HTML for the store. We have about 300
> products in 15 different categories. I set up some code to grab our
product
> categories and write the files to a directory. This file generator code is
> also the basic code to write all 300 of our product info files.
>
> My question is this.
>
> When I run this code, it works pretty well, but it takes a VERY long
> time...upwards of 3-5 minutes per file. To process all the products I had
> to set the server time out to some huge number.
>
> It seems to me that this is too slow but I don't know if this is normal
> cffile operation or is a result of poor coding and/or queries. Any
thoughts?
>
>
> Using CFStudio 4.5.2 RC1 beta
> CFServer 4.5 Single user
> Win2k
> Access97 backend
>
> <!---Begin file generator--->
> <cfquery name="ProdCatDESC"
> datasource="MyData"
> dbtype="ODBC">
> SELECT ProductCategoryDescShort, ProductCategoryID, MarketID
> FROM [QRY for Price Lists]
> Where MarketID = 5
> </cfquery>
>
>
> <!---begin looping thru product categories--->
>
> <cfloop query ="ProdCatDESC">
> <cfoutput query="ProdCatDESC" >
> #ProductCategoryDescShort#, #ProductCategoryID#
> </cfoutput>
>
> <!---set the variable to pass to template--->
>
> <cfset CatIDresults = #ProductCategoryID#>
> <cfset dirlocation = "C:\storeTEMP\store_ca\">
>
> <!---Call the template page--->
> <cfhttp
>
url="http://127.0.0.1/gen_cat_pages.cfm?MIDResults=1&CatResults=#CatIDresult
s#&dirlocation"
> method="get" resolveurl="false" UserAgent="Mozilla/4.0 (compatible; MSIE
> 5.01; Windows NT 5.0)" >
> </CFHTTP>
>
> <!--- Use Variable passed to find out what to call the save
> file...uses ProductCategoryDescShort as file name ie...bread =
bread.html--->
>
> <CFset URLAddy = #ProductCategoryDescShort#>
>
>
> <!--- Write the file to the directory --->
> <CFFILE action="write" file="#Dirlocation#\#URLAddy#.html"
> output="#CFHTTP.FileContent#">
> </cfloop>
> <!---end of file generator--->
>
> ----------------------------------------------
> Jay Bigam
> Marketing and Information Technology Manager
> Kinnikinnick Foods Inc.
> www.kinnikinnick.com
> Toll Free: 1-877-503-4466
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists