I was playing around with HTMLTidy in both the EXE and the COM version,
running them side by side in a loop to see what the difference in speed was
(the TidyCOM object is just a wrapper for the EXE). I put them both in a
loop, performing an operation using CFEXECUTE with the exe, then performing
the equivalent operation using CFOBJECT and outputting (via gettickcount())
their execution times. Running this loop through 10 iterations, I got the
following response curve:

COM: 8542 | EXE: 2794 
COM: 661 | EXE: 40 
COM: 140 | EXE: 50 
COM: 391 | EXE: 50 
COM: 370 | EXE: 21 
COM: 300 | EXE: 20 
COM: 180 | EXE: 40 
COM: 191 | EXE: 20 
COM: 170 | EXE: 30 
COM: 160 | EXE: 10 

I understand why one gets the drastic decrease in response time on the COM
object on the second and third hits (and given the money MS has poured into
COM and COM+ I would expect no less), but I don't understand why one gets
the drastic decrease in response time ON THE EXE on the second hit. Does
ColdFusion cache executables in memory, or use any other similar method?

Michael Caulfield 
Design Architect 
Cognitive Arts 



------ 

Just in case its an artifact of a poorly written test, here is the code I
used to run the test: 

<CFHTTP url="#FORM.htmlPage#" resolveurl="Yes"></CFHTTP> 
<CFLOOP from="1" to="10"index="i"> 
        <CFSET COMStart=getTickcount()> 
        <cfobject type="COM" class="TidyCOM.TidyObject" name="TidyObj"
action="CREATE"> 
        <CFSET tidyOptions = TidyObj.Options> 
        <CFSET tidyOptions.Load ("C:\tidyconfig.txt")> 
        <CFSET tidiedHTML=TidyObj.TidyMemToMem(CFHTTP.FileContent)> 
        <cfoutput>COM: #Evaluate(getTickCount()-COMStart)# |</cfoutput> 
        
        <cfset exeStart=getTickCount()> 
        <CFFILE action="WRITE" file="C:\temp\tidyFile.html"
output="CFHTTP.FileContent"> 
        <CFEXECUTE 
            NAME="C:\cfusion\customtags\tidy\tidy.exe" 
            ARGUMENTS="-config C:\cfusion\customtags\tidy\config.txt
C:\temp\tidyFile.html" 
            TIMEOUT="1000" 
                OUTPUTFILE="C:\temp\errors.txt"></CFEXECUTE> 
        <CFFILE action="read" file="C:\temp\tidyFile.html"
variable="tidiedHTML"> 
        <CFFILE action="delete" file="C:\temp\tidyFile.html"> 
        <cfoutput>EXE: #Evaluate(getTickCount()-exeStart)#<br/></cfoutput> 
</CFLOOP> 

  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to