Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I identify "slow" code?

Status
Not open for further replies.

Tama

MIS
Jun 6, 2001
121
0
0
NZ
I'm running a very complex/ mutilated version of PHPNuke/phpBB and have been running into performance issues with my server. After going through the long process of identifying the problem it seems to be resting in the PHP code (not MySQL as originally thought.)

There seems to be some code somewhere which is very processor intensive.

What I'd like to do is somehow produce a log which shows the amount of time sections of code take to load. Even if this was just done between functions and includes it would help.

Does anyone have any suggestions for software or code that would allow me to do this.

Thank you in advance.

Tama

I do my sums on fingers and thumbs.
 
OK - I must admit I started down this path (but with different search terms - "php profiler" works a lot better thank you.)

There seemed to be a huge amount of options available and I wasn't sure which one I should invest time into as most of them seemed fairly complex.

I'm running Apache (2.0.8 Fedora) and Linux (not sure the version) if anyone has any recommendations I'd love to hear them.

Thank you again
Tama

I do my sums on fingers and thumbs.
 
I think that PEAR has a section which will do the trick. I saw it mentioned in php cookbook. You start it off at the top of the php page and you insert a call at an appropriate place in the code, at the end it will display how long it took between steps.
or do you want a tool which will in real time tell you how much each line took to run, how many times it was called etc ?
 
I've been trying to install xdebug from but have run into problems with Zend Optimizer.

Derick who developed xdebug has been a great help but I just can't seem to disable the Zend Optimizer which is frustrating.

It's bed time at my end of the world so I'll sleep on it and see how I go in the morning.

Tama

I do my sums on fingers and thumbs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top