Performance Budgets and Bundle Size

Set speed targets for the tasks that matter, compare repeatable measurements, and do not confuse file size, lab scores, and what real visitors experience.

Content date: October 21, 2026.

Plain English

A performance budget sets limits on page speed and size. You might limit how long the main content takes to appear, response time after a tap, layout movement, or kilobytes downloaded. Record the page or task, device, network, measurement method, and percentile. Set limits that fit the product: fewer bytes alone do not guarantee that useful content appears sooner.

Use this when

Do this before you add large images, videos, or heavy interactions, when visitors complain of delays, and when you review a change that could slow the main journey.

If you are just starting

Choose one important page and one action, such as opening a bakery's menu and tapping Order. Record a baseline under stated conditions and repeat the test a few times. Find the biggest contributor before you change anything. Separate files loaded at the start from files loaded later. Practice percentiles with made-up numbers and label them as calculations, not measurements of a real site.

When your project grows

Combine controlled lab tests (Lighthouse is one) with field data from real visitors, which Google's Chrome User Experience Report supplies for many public sites through PageSpeed Insights. As of October 2026, the Core Web Vitals are Largest Contentful Paint (LCP, loading), Interaction to Next Paint (INP, responsiveness), and Cumulative Layout Shift (CLS, visual stability). INP replaced First Input Delay in 2024. "Good" means LCP of 2.5 seconds or less, INP of 200 milliseconds or less, and CLS of 0.1 or less, at the 75th percentile of real page loads. They do not replace your own goals for the task. Look at slow and failed cases, not only averages, and change one likely bottleneck at a time. Rerun your correctness checks and record whether the gain holds across devices, pages, and cache states.

Worked example

A made-up sample has eighteen 100 ms responses and two 4,000 ms responses. The mean is 490 ms, but the nearest-rank 95th percentile is 4,000 ms, so a report using only the average hides the slow cases. Think of a florist's checkout where one customer in ten waits four seconds. This small sample is good for practicing arithmetic and says nothing about a real site's performance.

Practice

Define a measurable performance decision

  1. Run the measurement practice and compare the mean and the percentile for the supplied made-up sample.
  2. Write a target for one task of your own, naming the device and network, the page, the cache state, the workload, the percentile, and what counts as success.
  3. Look at one real build file or local page and write down exactly what you measured. File size is not loading time.
  4. Propose one suspected bottleneck and a before-and-after test, with a condition for stopping.
  5. Save the results, the sample's limits, and the real-visitor checks you still need into the readiness report.

Deliverable: A budget for one task and an evidence table that separates made-up calculations, local observations, proposed tests, and field behavior you have not measured.

Common mistakes to watch for

  • A result from your fast laptop is presented as what customers experience on their phones.
  • An average hides the slowest visitors and failed requests.
  • Total build size is mistaken for what each visitor downloads at first.
  • A score improves because useful features or error handling were removed.
  • One noisy test run is called a proven improvement.

Prompting

A weak prompt

Get a perfect performance score by cutting the bundle below some small size.

A better prompt

The task I care about is [e.g. opening the menu and placing an order on a mid-range phone]. Help me set a budget with the page, device, network, percentile, and a rule that the task must still succeed. Measure a baseline several times, make one targeted change, and measure again. Keep build size, first-page downloads, lab results, and real-visitor data separate, and show me slow and failed cases and how much results vary. Don't claim a better experience from a score or file size alone.

Performance work pays off only when it fixes a delay a real person feels, and measured evidence keeps you from trading away working features for a prettier score.

Check before you move on

  • The user task is named.
  • The device, network, and test conditions are written down.
  • Slow cases and failures were looked at, not only the average.
  • File sizes are not treated as load time.
  • The feature still works after the change.
  • The limits of your data (lab versus real visitors) are noted.

You are done when

  • Another person can repeat your calculation and say what your local observation does and does not prove.
  • Your proposed fix has a measurable goal and keeps the page's behavior intact.

Questions to think about

A page's JavaScript compresses to just 80 KB. Does that prove it loads fast for everyone?

No. Network speed, other files, how long the browser spends running code, the device, and the task all affect the experience. Size covers only one piece.

Your site's average response is 500 ms, yet some customers complain it is painfully slow. What number should you look at?

A high percentile such as the 95th. An average can hide a group of slow experiences, and the percentile shows how bad the worst common cases are.

After a change, a broken page now returns its error twice as fast. Did performance improve?

Not in a way that matters. Faster failure does not complete the task, so check that the task succeeds as well as how long it takes.

Official references