Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 13 min read Deep dive mediumAdept

The Vitality of Core Web Vitals

Core Web Vitals, which became a Google Search ranking factor in mid-2021, consist of three metrics: Largest Contentful Paint (good at 2.5s or less), First Input Delay (good at 100ms or less) and Cumulative Layout Shift (good at 0.1 or less). Each is defined precisely: which elements count as LCP candidates, why FID measures only input delay and not handler time, and how a layout shift score is computed as impact fraction times distance fraction. Measurement can happen in the lab (Lighthouse, WebPageTest, the Web Vitals extension, with Total Blocking Time standing in for FID) or in the field (CrUX-based tools and RUM). Suggested fixes include trimming and tree-shaking third-party libraries, which cut Oberlo's bundle by 23%, and preloading critical assets, where preloading fonts improved Shopify's text paint by 1.2 seconds.

Assumes: browser rendering basicsJavaScript main thread

Related posts

  • Measuring soft navigation web vitals

    Sentry mediumAdept

    Chrome (Chromium 151+) now reports web vitals for soft navigations, and Sentry's JavaScript SDK v11 attaches per-navigation LCP, CLS and INP to SPA `navigation` spans by default, using span streaming because vitals finalize after the span ends. Measuring from the triggering interaction to the main content paint gives user-facing durations that idle-based span ends miss: in Sentry's app, page-load LCP is 2.85s at p75 while the pageload span ends at 6.77s. Page-load CLS/INP are cut off at the first soft navigation, and pages users only reach by clicking finally get data. Soft navigations made up about 62% of page views and had a p75 LCP of 1.17s versus 2.48s overall, so mixed scores will look better after upgrading. Alerts should be filtered on the new `browser.navigation.type` attribute.

  • New to the web platform in June

    web.dev easyNovice

    Chrome 149, Chrome 150 and Firefox 152 reached stable in June 2026. The headline change is that `field-sizing` and the `rect()`/`xywh()` shapes in `shape-outside` are now Baseline across all major engines. Chrome also adds CSS `text-fit`, gap decorations for grid and flex, `background-clip: border-area`, Promise-returning scroll methods, the declarative `focusgroup` attribute, and bfcache eligibility for pages with open WebSockets. Firefox adds interim and final response-header timing in Resource Timing and notification action buttons, while the Firefox 153 and Safari 27 betas preview features such as `Error.stackTraceLimit`, `getAllRecords()`, transform-aware anchor positioning and the `:heading` pseudo-class.

  • Rendering huge pull requests in the GitHub Copilot app

    GitHub Engineering mediumAdept

    The GitHub Copilot app's pull request view stays responsive on a 2,200-file, million-line diff with 400+ review comments by splitting document height into two geometries: exact, precomputed prefix-summed code rows and lazily measured dynamic blocks for comments, drafts and composers. A single idle- and scroll-gated measurement pass scoped to about 2400px around the viewport replaces per-block ResizeObserver write-back, which caused feedback loops. Observers only flag blocks for re-measurement, except for user-caused resizes, which commit synchronously at most once per frame. Identity-based scroll anchoring keeps corrections small, and a cache of recent diffs prevents an instantly drawn shell from sitting around an empty diff. Bugs were found with permanent in-app probes asserted as CI budgets and an autonomous headless change→measure→improve loop.

  • Optimizing WebKit & Safari for Speedometer 3.0

    WebKit hardMaster

    WebKit's Speedometer 3.0 work spans JavaScriptCore, DOM, style, layout, rendering and Safari itself, with measured gains for each change. The largest wins came from letting the simple text path handle font-variant-caps (4.5x on Editor-TipTap, ~7% overall) and from scheduling incremental sweeping and garbage collection opportunistically between rendering updates (6.5% on Speedometer 3.0). Other changes include reworked megamorphic and call inline caches, retuned inlining heuristics, lazy JIT code destruction, enum-based RenderObject type checks, cached CSS custom property resolution, and a larger IOSurface cache (hit rate ~30% to ~80%). Profile-guided optimization interacts with code changes in a surprising way: some improvements only appear, or briefly regress, until the PGO profiles refresh.

  • Performance Testing At Scale—for BFCM and Beyond

    Shopify Engineering mediumAdept

    Shopify prepares for Black Friday Cyber Monday by repeatedly running full-scale load tests against production: scaling Shopify Core and dependencies (nginx routing, ProxySQL, key/value store) to their BFCM profile, layering five Cronograma-driven traffic flows (browse/buy, admin, flash sale, Storefront API, Hydrogen/Oxygen) with an abort switch, then scaling down in reverse order and running blameless retrospectives. Full-scale testing is chosen over scaled-model testing because databases and vertically scaled components don't extrapolate and many failures, such as TCP connection-count exhaustion, appear just from running a larger fleet. Practical workarounds include partially bypassing the CDN to avoid overloading a few PoPs, cache-busting requests to avoid skewed results, and single-region failover tests to verify capacity.

The quest for software engineering knowledge.

Look:
Layout: