Can XDebug track separately the time spent for profiler calls? Can XDebug track separately the time spent for profiler calls? php php

Can XDebug track separately the time spent for profiler calls?


It is known that xdebug behaves like that and actually no news. Sorry, obviously this is news to you, and I don't want to say everybody needs to know that.

As an explanation: xdebug does the whole job, from beginning to end, dumping/metricating everyhing as announced. This comes with a price (how couldn't it?).

If you need to pick metrics in an isolated context within your script, you should not run xdebug. Or as your question shows: You're trying to profile xdebug with xdebug switched on (with PHP code!). That won't really work, you can't profile a PHP compiled C extension with PHP user-code, or at least I won't trust that much. Imagine the lib is changing the behaviour of the interpreter, that same interpreter your profiling code is running on.

If you really need to profile a specific part of your code isolated, xdebug is just not the tool of choice. Look for xhprof or maybe in a real life environment Pinba.


you are not supposed to expect the profilers results to be the same as normal opperation, it is inposseble(or you have to slow down opperation whith is not desireble)

but still the times in de profiler are verry usefull for example you can see that altrug the scripexcution taks longer the results are (some wat) cosistent with scale

using profilers is usefull to pointout problem spots, but ther results cannot be the same as reallife is to mutch optimized(at least with xdbug)


Definitely give xhprof a try. Seems less prone to errors. Not to knock Xdebug.