I trying to profile my php app but cant understand indicators in qcachegrind. followed screenshot:
its function calls of course. but what means columns incl. and self ? how should i recognize here that some method is need to refactor ?
"self" is time of executing the function WITHOUT any includes (and other function calls) inside it and "include" is the whole time of function execute (with including files, function etc). Take an example:
function a()
{
b();
c();
}
function b() { // some code }
function c()
{
d()
}
function d() { // some code }
Function a self time will be approximately zero, but since it calls b and c, its include time will be highest and contains time for a, b and c. Similarly b self and include time will be same as it is not calling any function. Whereas c self will be approximately 0 and include time being approximately equal to d include time.
Looking at your qcachegrind, your code is spending a lot of time in the PDO calls. Something related with the SQL query. You also want to capture your SQL queries and profile them to see how they are doing.
Also interesting in the output is number of times a function is called. A function may be efficient in terms of performance, but if it is called too many times, it will add up. Check if the code if making too many SQL queries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With