Client: „site is slow”. Ty: „to pewnie database”. Fact: to external API call zajmuje 5 sekund. Assumptions błędne. Profiling reveals truth.
Server-side profiling
Xdebug profiler generates callgrind file. Tools jak KCachegrind show które functions take longest. Visual representation where CPU time spends.
MySQL slow query log
MySQL logs queries >2 seconds. Analyze które są powolne. EXPLAIN statement shows execution plan. Full table scan (bad) czy index lookup (good)?
Frontend profiling
Chrome DevTools Performance tab. Record page load. See where JS takes time, rendering blocks, layout shifts. Waterfall view: DNS → TCP → Request → Response → Parse → Rendering.
Real User Monitoring
Chrome sends Core Web Vitals data to Google. Google shares w Search Console. See real user experience nie just tests.