Debugging INP on Shopify PDPs: The Variant Picker Is Usually the Villain
Interaction to Next Paint quietly tanks Shopify product pages, and the variant picker is nearly always the culprit. Here's how we trace it, what causes it, and the patterns that actually bring INP under 200ms.
Every Shopify audit we run in 2026 opens the same way: LCP is fine, CLS is fine, and INP is a disaster. The product detail page passes on desktop and fails on mid-range Android, and the owner cannot work out why a page that feels fast is quietly being penalised. Nine times out of ten, the variant picker is doing something awful on tap.
This is a field guide to finding it and fixing it, pulled from a handful of recent builds on Dawn-derived themes and a couple of Hydrogen storefronts.
Why INP Became the PDP Problem
INP replaced FID in March 2024, and the shift was not cosmetic. FID measured the delay before the browser started handling an interaction. INP measures the full round trip: input delay, processing time, and the paint that follows. On a PDP, the first meaningful tap a user makes is almost always a variant swatch — colour, size, material. If that tap triggers a cascade of synchronous work before the next paint, you lose.
Google's threshold is 200ms at the 75th percentile. In our experience, a stock Dawn theme on a merchant with 30+ variants and a few apps installed will sit somewhere between 280ms and 650ms on a Moto G Power over 4G. That is a failing grade, and it is not usually the theme developer's fault — it is the accumulated weight of apps, analytics, and the variant-change event itself.
What actually happens when a user taps a swatch
On most Shopify themes, tapping a variant swatch triggers roughly this sequence:
- Click handler fires, reads the selected option values from the DOM.
- Matches against the full
product.variantsJSON blob embedded in the page. - Updates the URL via
history.replaceStatewith the new?variant=param. - Dispatches a custom event (
variant:changeor similar). - Every listener — price, availability, media gallery, SKU, inventory, apps — reacts.
- The media gallery often re-renders, swapping the main image and sometimes the entire carousel.
- Apps like reviews, bundles, subscriptions, and back-in-stock all re-evaluate.
- Browser finally gets to paint.
Step 5 is where INP goes to die.
Profiling the Interaction
Before you change anything, record what is actually happening. Open Chrome DevTools on a throttled profile (4x CPU slowdown, Fast 4G) and use the Performance panel's Interactions track. Tap a variant. You will see a bar showing input delay, processing, and presentation delay, colour-coded.
What we look for:
- Input delay over 40ms — main thread was busy when the tap landed. Usually a third-party script or a lazy-loaded chunk still parsing.
- Processing over 150ms — your own handlers are the problem.
- Presentation delay over 50ms — a layout or paint storm, often from the media gallery swap.
For real-user data, the event-timing API is the honest mirror. Wire it into your analytics so you are not relying on CrUX-only aggregates:
const observer = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (entry.interactionId && entry.duration > 100) {
analytics.track('slow_interaction', {
duration: Math.round(entry.duration),
type: entry.name,
target: entry.target?.tagName,
startTime: Math.round(entry.startTime),
});
}
}
});
observer.observe({ type: 'event', durationThreshold: 40, buffered: true });
Ship this behind a sampling flag — 5% of sessions is plenty — and you will know within a day which interactions are slow and on which pages.
The Five Patterns We See Most Often
1. The variant JSON is enormous
Merchants with configurable products often have 200–800 variants. The theme embeds the full array as JSON and every tap filters it in a for loop. That is fine for 20 variants. At 500, with option-matching logic that does three nested find() calls, you are burning 60–120ms before you have painted anything.
Fix: precompute a lookup map on page load, keyed by a stable concatenation of option values.
const variantMap = new Map();
for (const v of product.variants) {
const key = v.options.join('|');
variantMap.set(key, v);
}
// on swatch tap:
const variant = variantMap.get(selectedOptions.join('|'));
That turns a 60ms scan into sub-millisecond work.
2. The media gallery re-renders instead of switching
Many themes destroy the gallery component and rebuild it when the featured variant changes. If you are using Flickity, Swiper, or any carousel library, the rebuild dominates INP. The fix is to keep the gallery mounted and simply scroll or fade to the slide associated with the new variant.
If the variant has unique media, pre-register all media on mount and use scrollIntoView({ behavior: 'instant' }) or a CSS class swap. Do not call .destroy() and .init() on tap.
3. App blocks listening to variant:change
This is the ugly one. You have no control over third-party app blocks, and they often attach synchronous listeners. Reviews widgets, bundle apps, and subscription apps are the usual offenders.
Mitigations:
- Audit app blocks on the PDP template. If an app is not driving revenue, remove it.
- For apps you need, wrap their listeners in a
requestIdleCallbackshim where possible by interceptingaddEventListenerearly in the page lifecycle. This is invasive and should be a last resort. - Push vendors to use app block sections with lazy initialisation via the Shopify theme app extensions model.
4. history.replaceState triggering router logic
On Hydrogen or custom headless builds, changing the URL can cause the router to think it needs to refetch. If your variant change is purely client-side state, suppress the route handler or use a scoped state atom instead of the URL until the user commits (adds to cart).
In our builds we often keep the selected variant in a Zustand store and only sync to the URL on a debounced timer, 300ms after the last interaction. Shareable URLs still work, INP stays clean.
5. Hydration-blocking scripts on first interaction
If your theme or framework defers hydration (Astro, Qwik, or Hydrogen's streaming SSR), the first tap can land before the island is interactive. The browser queues the event, your script finishes parsing, and INP blows past 400ms purely from input delay.
Fix: prioritise hydration of the buy box island above the fold. Everything below the fold — reviews, related products, FAQs — can wait. Hydrogen's `` with strategy="afterHydration" is a good default for the non-critical stuff.
Measuring Your Way Out
Set three budgets and track them weekly:
- Variant tap p75 INP: under 200ms (the Google threshold)
- Variant tap p95 INP: under 500ms (catches the long tail)
- Add-to-cart tap p75 INP: under 200ms
If you cannot measure a budget, you will not hold it. The event-timing snippet above feeds a dashboard; the dashboard drives the backlog.
Don't optimise what the user does not touch
A trap we have fallen into: spending a week rewriting the image preloader because it felt slow, only to find that only 3% of users ever swiped the gallery. Meanwhile, 71% tapped a swatch within the first eight seconds. Instrument the funnel first, then optimise where the taps actually land.
The Honest Trade-offs
Some of these fixes push complexity into the theme. A lookup map is harmless. Taking over app-block event handling is not — it creates a maintenance burden and can break on app updates. A pragmatic order of operations:
- Ship the
event-timingobserver today. - Build the variant lookup map and kill the carousel rebuild.
- Audit and remove unused app blocks on the PDP.
- Only then consider defer-hydration tricks or state management rewrites.
Most merchants get from a failing INP to a passing one with the first three. The last one is for stores where the PDP is a genuinely rich configurator.
Where We'd Start
If you have ten minutes before a stakeholder meeting: open DevTools, throttle to 4x CPU, record a performance trace while tapping three variants in sequence, and screenshot the Interactions track. That one image usually tells you whether you have a processing problem, a rendering problem, or an app problem — and it gives you something concrete to argue about rather than a vague "the page feels slow". The rest of the work follows from there.
If you want a second pair of eyes on a PDP that is struggling, our e-commerce team runs these audits regularly and will usually find the top three wins in a half-day.
Want a team like ours?
72Technologies builds production software for the kind of teams who actually read this blog.
Start a projectKeep reading
Shopify Shop Pay vs Custom One-Page Checkout: When It's Actually Worth Leaving
Shop Pay converts well, but it isn't free of tradeoffs. Here's the honest math on when a custom checkout beats it, and when leaving is a mistake you'll regret in six months.
Serving Shopify Collection Pages Under 200ms: A Caching Playbook
Collection pages are where browse intent turns into cart intent — or bounces. Here's the caching strategy we use to get Shopify category pages responding under 200ms at the edge, without fighting the platform.
Why Your Shopify LCP Is Stuck at 3.2s (And the Six Fixes That Actually Moved It)
A field report on dragging Shopify product page LCP from the mid-3s into the low-2s. The usual advice doesn't cut it — here's what actually worked across three merchants in 2025.
