After clicking “Continue,” the form freezes even though the initial load is fast. Check the profile for the specific interaction. The cause could be synchronous validation, a third-party script, a re-render, or waiting for the network; a long task and a slow API require different solutions.
Repeat the specific click using test data
INP describes interaction responsiveness and includes delays before processing, execution, and presentation of the next frame. Official documentation.
Specify the exact action: entering a character, selecting an option, or clicking Continue. Record the form state and input size without saving personal information. A fast initial load says nothing about expensive checks after a click. Describe the expected feedback: a message, a transition, or a waiting state. If the delay occurs only with long text, treat that input as a separate test case. Don’t call the entire form slow based on a single overall score. The profile should match the specific action the user experiences as a freeze.
Distinguish computation from waiting for the server
| Action stage | Where the delay occurs | Where to look | What to preserve after optimization |
|---|---|---|---|
| Click | Event handler | Record a profile | Identify work on the browser’s main thread |
| API response | Network stage | Compare Network results | Measure the delay separately |
| Field error | Validation | Check the result | Don’t remove the check |
| Repeated click | Duplicate action | Check the lockout | One intended request |
Synchronous computation can delay showing a state even before the server receives a request. A slow API can delay the result while the browser remains responsive. Record when the request starts, when the handler runs, and when the message or spinner appears. If the browser is busy computing, fix the handler code; if the request starts immediately but the response arrives late, investigate the API delay. Check scrolling and other elements while waiting in a test copy. You can’t infer the cause from a spinner: it may appear late precisely because the main thread is busy. First compare the network log with the execution profile.
Find the function in Performance
Start a Performance recording before the action and stop it after the result appears. Find the corresponding interaction, handler execution, long tasks, and layout work. Check the stack to identify the function and source code. If a long task started before the click, the delay may occur while a background widget is running. A long task in the recording is not itself an INP value. What matters is whether it prevented this click from being handled and the next frame from being shown. The interaction metric includes several stages, and the specific profile helps identify which one needs to be fixed.
In Chrome, start a Performance recording, click the test button, and stop the recording after the response. On the Main track, select the long task near the click, open Call tree, and locate the function’s file and line. In Network, check whether the request started before the freeze. Use a test handler: you don’t need to submit a real request to make a recording.
Compare short and long text
Suppose the form checks the entered text before sending a request. Compare short and long safe inputs in the same version and on the same device. The recording should show where computation increases and when the network request starts. Then temporarily replace the confirmed expensive stage in a test copy and repeat the action. If the delay disappears without that stage, you’ve found the cause. In the production version, speed up the check while preserving its result and errors. Don’t submit real requests to create a profile. Use the provided test handler or stop submission after observing the local stage.
Reduce the synchronous work you found
Choose an optimization based on the stack: eliminate repeated calculations, use a more efficient algorithm, split up the work, or use an appropriate worker. Don’t mechanically move DOM operations into a worker, because it cannot access the page’s regular DOM. For a major rewrite, preserve the correspondence between validation results and errors. If repeated layout is the problem, separate reads and writes in the component architecture. If the issue is a third-party script, check whether its startup behavior can be changed. Simply adding a setTimeout delay is not enough if the entire expensive block still runs as one task and blocks the next action.
Preserve validation and duplicate-submission protection
After optimizing, test valid data, an invalid field, a network failure, and a repeated click. The “Checking your data” message or spinner should appear immediately after the click and not obscure the form. The button shouldn’t create several identical requests while an action is being processed. Don’t hide an error to make the form feel faster. If the result arrives later, make sure the user can understand the current status and recover from a failure. For keyboard users, check focus after an error and after continuing. After speeding things up, repeat the entire action: valid data goes through, invalid data shows an error, and a repeated click doesn’t create a second submission.
Repeat the successful and error scenarios
The form provides feedback faster after the same click. An invalid field still triggers the required error, a network failure is explained, and a repeated click doesn’t create two requests. Profiling one action helps with diagnosis, but doesn’t replace INP across the audience.
Read also: INP (Interaction to Next Paint): how to optimize responsiveness and JavaScript performance optimization: a complete guide for web developers. Website checks are available on the reChecker technical audit page.