how do I indentify which section of code is slow?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default how do I indentify which section of code is slow?

    I have a query that loops over several CFIF statements. The page seems to be
    rendering too slow. Is there a way where I can put some code around several
    blocks of code, to display the amount each block is taking to process? The
    debugger gives me a total, but I'm trying to isolate sections. I am using CFMX 6

    braseth Guest

  2. Similar Questions and Discussions

    1. PHP: Restrict access to a section of code
      hi guys, I have implemented the login/user auth sections of my webby without any problems. Ive used the built in server behaviours in DW8. So i...
    2. Section headers—did I do it right?
      Hi, I've created a multi-section document in InDesign CS. I'd like each odd-numbered header to contain that section's title. After hours of...
    3. SLOW DOWN..Why is my Photoshop CS Super Slow in PANTHER?
      G5 DUAL 2GHZ .. 1 GB RAM .. PHOTOSHOP CS .. PANTHER/JAGUAR ........................................................... I've had my DUAL G5 since...
    4. How can I keep a section of code from firing?
      I am wondering if I am attempting the impossible on one page. CODE: set current= cConn.Execute(SQLCurrent) Do Until current.eof Response.Write...
    5. Injecting code into the <head></head> section
      Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that...
  3. #2

    Default Re: how do I indentify which section of code is slow?

    If you were using CFMX 7, I could tell you to use the <cftimer> tag, but how
    about doing it this way instead. You could output the time before your code
    executes and after it is done. Like this:

    <cfoutput>#now()#</cfoutput>
    execute your slow code
    <cfoutput>#now()#</cfoutput>

    You could do calculations on it to, like:
    <cfset variables.before = now()>
    execute your slow code
    <cfset variables.totalTime = now() - variables.before>
    <cfoutput>#variables.totalTime#</cfoutput>

    Hope this helps!

    CF_DAWG Guest

  4. #3

    Default Re: how do I indentify which section of code is slow?

    You can also use the <cftrace> tag and it will return more information than my code from my previous post. Look in your documentation for more syntax on <cftrace>.
    CF_DAWG Guest

  5. #4

    Default Re: how do I indentify which section of code is slow?

    You could use GetTickCount() to time code blocks

    <cfset Start = GetTickCount()>
    Slow code block
    <cfset TimeToRun = GetTickCount() - Start>
    <cfoutput> It took #timeToRun# milliseconds to run the code</cfoutput>

    OldCFer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139