A function with high inclusive cost and negligible self cost is not slow — it calls something slow, and usually many times.
Incl. Self Called Function
98.2% 0.1% 1 {main}
71.4% 2.1% 412 Product::currentStock
68.9% 1.4% 412 StockRepository::forVariant
64.2% 61.8% 412 PDO::query
3.1% 2.9% 1 PriceCalculator::calculate
sort by SELF to find the cost. sort by INCL to find who
caused it. the call count is what names the bug.
The call count is the third column and is the one that identifies an N+1 immediately: 412 calls to a two-millisecond query is invisible in a slow query log and is the whole request. The calculation everybody suspected is three per cent. Reading a profile well is mostly the discipline of looking at all three numbers rather than the first one that confirms a theory.