Thanks Adam.

Lee Foster
(e)consultant, Web developer, Web Architect
[EMAIL PROTECTED]
615-834-1876
http://www.l3enterprises.com
Nashville, TN
-----Original Message-----
From: Dray, Adam [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 5:40 PM
To: '[EMAIL PROTECTED]'
Subject: Performance cost of fusedoc (was: Fusedoc-ing Exceptions)

Lee Foster said:

"I have an opinion style question.  I know and understand the purpose of
fusedocs and by no way I'm I against it.  (Trying to dodge any possible
bullets).  Ok here is the question.  On a web server with a heavy load is it
possible that the increase file size could cause or aid in performance
issues.  In this case would it be better to create a separate file with the
fusedoc and make a single line reference in the template to it."

My gut feeling was that CFAS munches through comments without skipping a
beat. I wrote a little test to verify this hunch. I created four templates:

1. inc_comments.cfm with the Fusedoc header from the CF5.0 Fusebox corefile.
2. inc_blank.cfm with a single blank line.
3. test_comments.cfm with a cfloop to cfinclude inc_comments.cfm 50,000
times and time the results.
4. test_blank.cfm to test inc_blank.cfm in an identical manner to #3.

The test templates look like this:

    <cfparam name="url.loops" default="50000">

    <cfset start = Now()>
    <cfloop from="1" to="#url.loops#" index="i">
        <cfinclude template="inc_comments.cfm"> <!--- the blank test uses
inc_blank.cfm, of course --->
    </cfloop>
    <cfset end = Now()>

    <cfoutput>
        <h1>Comments Test</h1>
        <p>Iterations: #url.loops#
        <p>Start: #TimeFormat(start, "hh:mm:ss")#
        <p>End: #TimeFormat(end, "hh:mm:ss")#
        <p>Duration: #DateDiff("s", start, end)# seconds
    </cfoutput>

Results:

Both test pages run 50,000 iterations in 37 seconds on my development
server. I see no real difference between them. The time spent in the actual
inc_* files is negligible compared to the time in the test_* files.


Output:

Blank Test
Iterations: 50000
Start:      06:30:17
End:        06:30:54
Duration:   37 seconds
----------------------------------------------------------------------------
----
Execution Time
36922 milliseconds
    0 ms   D:\INETPUB\WWWROOT\ADAM\APPLICATION.CFM
 1717 ms   D:\INETPUB\WWWROOT\ADAM\CONCEPTS\PERFORMANCETEST\INC_BLANK.CFM
35782 ms   D:\INETPUB\WWWROOT\ADAM\CONCEPTS\PERFORMANCETEST\TEST_BLANK.CFM
   15 ms   STARTUP, PARSING, & SHUTDOWN


Comments Test
Iterations: 50000
Start:      06:31:29
End:        06:32:06
Duration:   37 seconds
----------------------------------------------------------------------------
----
Execution Time
37375 milliseconds
    0 ms   D:\INETPUB\WWWROOT\ADAM\APPLICATION.CFM
 1710 ms   D:\INETPUB\WWWROOT\ADAM\CONCEPTS\PERFORMANCETEST\INC_COMMENTS.CFM

36132 ms
D:\INETPUB\WWWROOT\ADAM\CONCEPTS\PERFORMANCETEST\TEST_COMMENTS.CFM
    0 ms   STARTUP, PARSING, & SHUTDOWN

--
Adam Dray


"The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent.  This message
and its attachments could have been infected during transmission.  By
reading the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects.  The sender is not liable for any loss or damage arising in
any way from this message or its attachments."

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================


Reply via email to