Skip to main content
Participant
April 28, 2010
Question

About execution time. Kindly suggest.

  • April 28, 2010
  • 1 reply
  • 419 views

Hello,

In debugging info, what does 'Total time' and 'total execution time' actually mean? I have below info, if i add up total time (21578) of each row, it is not even near to last row (7625, one third of sum), TOTAL EXECUTION TIME :

Execution Time

Total TimeAvg TimeCount
7500 ms7500 ms1
6766 ms6766 ms1
4313 ms4313 ms1
1218 ms1218 ms1
719 ms719 ms1
719 ms719 ms1
110 ms110 ms1
110 ms110 ms1
78 ms16 ms5
15 ms15 ms1
15 ms15 ms1
0 ms0 ms1
0 ms0 ms1
0 ms0 ms1
15 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
7625 ms TOTAL EXECUTION TIME

That would be really greatful if anyone can explain this. I have taken up optimization project and need real statistics to show.

Thanks,

Tushar Saxena

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 28, 2010

    The "Total Time" is the total time that template runs for during the request (which could be the sum of however many times it was called).  That's easy enough.  However a given template might include other templates, which will also be listed, along with execution times, however the included templates will obviously contribute to the exection time of the template including them, so that execution time will be represented twice on that list: one for the included template, one for the template doing the including.  So one cannot sum that column and expect to get the number at the bottom.

    Say for example you have myPage.cfm, which has an execution time of 500ms.  It includes inc_header.cfm which itself takes 100ms to run, and inc_footer.cfm which takes 100ms too.  So the 500ms for myPage.cfm includes 300ms of its own code's execution time, as well as each of the 100ms execution times of the header and footer.

    Also bear in mind that those figures in the debug are OK to represent comparative execution times between templates, the figures are not "real world" execution times, as having debugging switched on slows down each template's execution time drastically.  There's also a moderate margin of error in there.  A template that does basically nothing will oscillate between 0ms and 16ms, in my experience.

    You should be aiming for a total execution time not more than 500ms, I should think, unless the page some sort of bulk-processing script, or the length of the page is longer than what one might consider "average": say a search in which the user has opted to list 100 results per page, rather than the more common 10-20.

    The best place to look for optimisations is poorly written SQL: returning too many columns or two many rows, or simply hitting the DB more than is necessary (having <cfquery> tags in a loop), or not parameterising one's SQL statements.

    --

    Adam

    Participant
    June 18, 2010

    Thank you Adam for your Valuable suggestion.

    Regards,

    Tushar Saxena