Framework performance problems are often attributed to the ORM before anyone measures the request. Profiling helps distinguish database time from template rendering, network calls, serialization and application code.
Establish a repeatable scenario
Choose a representative route and realistic data volume. Record runtime version, cache state, database size and request parameters. Compare cold and warm behavior separately.
Inspect query behavior
Look for repeated queries, unbounded result sets, missing indexes and expensive serialization. An N+1 query pattern may require eager loading, but eager loading every relation can also create oversized joins or memory use.
Measure external dependencies
Record time spent waiting for payment, mail, search or other remote services. Use timeouts and asynchronous work where appropriate; do not hide slow dependencies behind an unbounded request.
Verify the improvement
Repeat the same test after a change and compare both latency and resource use. Add a regression test or performance budget for important paths.
Further reading
- Blackfire documentation: https://docs.blackfire.io/
- Xdebug profiler: https://xdebug.org/docs/profiler