0

Looking for some [freeware/opensource] tool in order to make it easy to profile a big php project on win32 platform. Need to find out which part of code is most time consuming. It's hard to manually put timing function for each function, loop...

4 Answers 4

6

You'll want to install and configure Xdebug. It's sort of the de-facto standard PHP debugging and profiling tool.

WinCacheGrind can crunch the profiling output. It's a bit buggy, but it does the job.

Sign up to request clarification or add additional context in comments.

6 Comments

You beat me twice!?!? curses!
Haha... it's like the Wild West of programming around here ;)
Thanks guys! WinCacheGrind is really buggy, tried to open multiple output files with no success. Tried also webgrind - but do I have to stop server every time I need to use webgrind with latest output file, so web server will release it? Or I'm doing something wrong...
I usually just copy the output files to a local machine to grind them there, otherwise the get overwritten on subsequent requests. They can be extremely large as well, so it's easier to crunch locally. Best bet is to have a local development copy of the app if you can.
For wincachegrind you have to make sure that the grind's filename is exactly as it expects otherwise you will not be able to grind it.
|
2

xdebug works quite well http://xdebug.org

Also wincachegrind is a good tool for looking through the profiler's output. http://sourceforge.net/projects/wincachegrind/

As well as (if the profile file is small) webgrind http://code.google.com/p/webgrind/

Comments

1

In addition to the excellent xdebug (as mentioned by others), you can also look at xhprof.

2 Comments

is one faster than the other? I find xdebug changes things from: they are slow I wonder why, to: I will go make lunch and come back to it when it is done.
I haven't had the chance to use xhprof yet, so I can't testify as to the speed.
1

Yes, use XDebug, and once you're in it, use this technique, which works on any platform.

Don't think of it as measuring time.

Think of it as trying to ask, predominantly, What is it doing, and Why is it doing it?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.