Is it possible, or has anybody tried to profile a PHP page. I'm not talking sticking in time counters etc, but proper function profiling.
Is this part of PHP, or are there any plans for it?
Shaun
Depends on what you mean by "proper function profiling"
What should a page do to qualify?
Return information regarding:
function execution times number of times a function was called call stack depths percentage time spent in functions
Ever done a profile from Visual C++?, something like that kinda of information.
Nope, I have never had much use for that kind of data. I have timed a few functions to see which was faster, but the rest....
We want to do something similar.. Basiclly get profile information from our appication that has custom PHP extensions and thousands lines of code. So it's not really realistic to modify all the files to take timestamps. We are trying to write an extension that marks function timing/performance in a non-obtrusive way. Like make a prepend file that calls start_profile() then appends a stop_profile(). This could write the data to the page or to a file. It could also be used to debug problems in production by maybe setting a secret cookie that will enable profiling for a single user without slowing down the other users. The hardest part seems to be finding the right Zend API to get the run-time information during a request...