Skip to main content

Metrics for evaluating performance

1. Frontend (browser) performance metrics

These metrics evaluate how fast and smoothly a page loads and responds:

MetricWhat it measuresGood value
FCP (First Contentful Paint)Time until the first content is rendered (text, image)< 1.8 sec
LCP (Largest Contentful Paint)Time until the largest content element is displayed (for example, a banner, an image)< 2.5 sec
FID (First Input Delay)Delay between the user's first action (click, scroll) and the page's response< 100 ms
INP (Interaction to Next Paint)How fast the interface responds to user actions (a newer metric that replaces FID)< 200 ms
CLS (Cumulative Layout Shift)How much the content shifts during loading< 0.1
TTFB (Time To First Byte)Time until the first byte of the server's response is received< 0.6 sec
TBT (Total Blocking Time)Total time the main thread is blocked and cannot respond< 200 ms

These metrics are collected via:

  • Lighthouse, PageSpeed Insights
  • the Performance API (performance.getEntriesByType('navigation'))
  • the Web Vitals SDK

2. JavaScript performance metrics

To evaluate the speed and efficiency of JS code execution:

MetricWhat it evaluates
Execution timeTime taken by a piece of code (for example, using console.time() / performance.now())
Memory usageMemory consumption (performance.memory.usedJSHeapSize)
Garbage collection timeFrequency and duration of GC pauses
Event loop lag / latencyHow much the main thread is blocked
FPS (Frames per second)The interface's refresh rate (should be 60 FPS)
Recalculate Style / Layout / Paint timeTime spent painting and rebuilding the DOM
Script parse/compile timeTime spent parsing and compiling JS files

Tools used:

  • Chrome DevTools -> Performance
  • React Profiler / Vue DevTools
  • Lighthouse -> the "Diagnostics" tab

3. Backend performance metrics

If we're talking about Node.js, NestJS, Express, or an API service:

MetricWhat it shows
Response Time / LatencyThe server's average response time
Throughput (RPS)Requests per second
Error rateThe share of failed requests (4xx/5xx)
CPU usageProcessor load
Memory usage (RSS, heap)Memory usage
Event loop delayHow much the event loop is blocked
DB query timeAverage SQL query execution time
Cache hit ratioCaching efficiency

For measurement:

  • Prometheus + Grafana
  • New Relic, Datadog, Sentry Performance
  • Node.js's built-in performance API

4. User experience metrics (UX Perf Metrics)

MetricWhat it reflects
TTI (Time To Interactive)When the page becomes fully interactive
TBT + INPHow comfortable interacting with the page is
User timing marksCustom points via performance.mark() and measure()
Perceived performanceThe subjective feeling of "speed" via skeletons, lazy loading, prefetching

5. Integrated indices

MetricWhat it composes
Speed IndexHow fast all content visually loads
Performance Score (Lighthouse)A composite score on a 0-100 scale
Core Web Vitals ScoreGoogle's metric for SEO and UX

Summary

For the browser - FCP, LCP, INP, CLS, TBT For JS code - Execution time, memory, FPS, GC For the server - Latency, RPS, CPU, DB time For UX - TTI, Speed Index, User timings

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.