> Does anyone know of any functions / tools / utilities / whatever that can
be
> used to provide a timing of the execution of each line of a php program?
I'm
> guessing this would probably be a test harness or a debug app or
something.
>
> I've used timing functions to record the execution of blocks of code or
> entire scripts, but I'm interested in taking it this one step further.

What you describe is called a "profiler".

AFAIK, there aren't any for PHP at this time.

The odds on somebody writing one within the next six months now that there
are a half-dozen IDEs:  A virtual certainty.

Meanwhile, some rules of thumb:

Your biggest time-sink is your xxx_connect() to the database.  Use
xxx_pconnect().
P is for 'P'ersistent.  The Persistence is on the *database* side, *NOT* in
PHP.
Usual Stumbling Block: Your database has to be configured to have more
possible connections than the number of httpd processes.  Stress-test on a
development box to be sure you configured everything properly, or be
prepared to weep.

If you can do it in SQL instead of PHP, do it in SQL.
SQL has been optimized to hell and back for decades.  PHP is fast, but it's
designed to be easy as well, not to rip through a million records in minimal
time.

If it's something you'd expect somebody else to have needed a whole lot, PHP
probably has a built-in custom function for it that will beat the pants off
anything you can write in PHP.

The previous statements really are not arguable.  The next two will
undoubtably draw the ire of about 70% of this list.  Tough $#!^

[asbestos mode on]
Over-engineering your site with forty-leven Object-Oriented class include
files is a Bad Idea.
Unless you can afford the Zend Cache, in which case you don't care.

Over-engineering your site with a Template system so your graphic designer
can easily change GREEN to BLUE, but if they want to add a column you have
to re-code the damn PHP anyway is stupid.  Either re-educate your Graphic
Designers to grok a minimal amount of PHP, or have them edit PHP files using
an editor that won't screw up your PHP and you can re-edit it after to
re-integrate their static HTML as dynamic or have them edit a static sample
page and you re-integrat it or design the parts that you just know the
Graphic Designer will want to change as a non-PHP include file or...  Just
about anything other than a Template library is going to end up being lower
TCO in the long run.
Ditto on the Zend Cache.
[/asbestos]

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to