Forum Moderators: phranque

Message Too Old, No Replies

Identifying bottlenecks

Finding out what's slowing down scripts

         

TGecho

12:06 am on Oct 14, 2003 (gmt 0)

10+ Year Member



Are there any general techniques for figuring out where a script is bottling up?

mattur

4:22 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could profile the script by setting a timer going at the start of the page, then writing out the time elapsed after each major script operation.

Something like:

1. Start timer
<do first operation>
2. Return time elapsed in page
<next operation>
3. Return time elapsed in page
etc.

If you put the timer code in include files it's quite easy to switch into and out of your pages.

Generally speaking, accessing external services e.g. database, ldap, smtp etc will have the biggest performance hit. HTH