tags:

views:

187

answers:

6

Is there free and good line-level profiler for PHP? I'm using xdebug and it's relatively good but it gives me function level output and sometimes it's hard to see where exactly all the time spent in the function goes.

A: 

I don't know if there is such profiler.
If possible, a workaround could be to split long functions that are identified to be bottleneck to smaller functions. Not only that's good programming practice (although not always easy to enforce, I reckon), but it might allow to pinpoint more precisely the problem.

PhiLho
+1  A: 

There is bytekit, which is an opcode disassembler. That will give you a detailed view of what is going on. Alternatively, you can use C-level debugger such as gdb. This gives you an even closer look, since you can debug in to C-level functions.

troelskn
A: 

I'm relatively sure I got line-level output with Xdebug and KCacheGrind. Could've been it reported it for those lines with function calls based on how long that function took, but in any case.

Jani Hartikainen
No, it can show you source code and info about how much time function called from this line took. But it doesn't help with lines where only language constructions are used.
vava
+1  A: 

Zend Platform will give you some more precise profiling information. Its that or using webgrind and zend studio / Eclipse profiler for you performance information.

Crassusg
+1  A: 

Not free, but the SD PHP Profiler provides information about the relative costs of each block of PHP code, not just functions:

Ira Baxter
I can't think of a more complicated interface :)
vava
A: 

I am using a microtime() and it suits me well.

Col. Shrapnel