Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

perf(marketplace): state what the themed-picks lazy load actually buys

nirholasc544eb35398c
diff --git a/docs/site-performance.md b/docs/site-performance.md
index ec65e06c1..50c941216 100644
--- a/docs/site-performance.md
+++ b/docs/site-performance.md
@@ -112,7 +112,9 @@ All three are gated in [pages/home.html](../pages/home.html) with a `rootMargin:
The same rule covers 3D viewers, and it needs its own mechanism because the platform default does not work. **`loading="lazy"` on a `<model-viewer>` is not enough on a page that renders many of them.** Slides in a carousel occupy one box and are hidden with opacity rather than `display`, so every one of them intersects the viewport at once and model-viewer's own lazy loading holds nothing back; a grid card is a different shape but the cost is the same once the cards are on screen.
-So [src/marketplace.js](../src/marketplace.js) uses a `data-src` contract instead. A viewer ships `data-src` rather than `src`, and `observeCardModelViewers()` promotes it to `src` on first intersect at a 200px margin, adds `auto-rotate` there, and *removes* `auto-rotate` when the element leaves so an offscreen viewer is not running a raf loop. The grid cards and the hero carousel already worked this way. The themed-picks strip did not, and that made it the last eager viewer on the page. On `/marketplace`, `model-viewer` was the single most expensive script in the trace at **7,924ms of evaluation**.
+So [src/marketplace.js](../src/marketplace.js) uses a `data-src` contract instead. A viewer ships `data-src` rather than `src`, and `observeCardModelViewers()` promotes it to `src` on first intersect at a 200px margin, adds `auto-rotate` there, and *removes* `auto-rotate` when the element leaves so an offscreen viewer is not running a raf loop. The grid cards and the hero carousel already worked this way. The themed-picks strip did not, and that made it the last eager viewer on the page. On `/marketplace`, `model-viewer` is the single most expensive script in the trace at **7,924ms of evaluation**, across the grid, the hero and the strip together.
+
+Measured honestly, that last one is the smallest of the three: at 1350x940 the strip sits at y=137, above the fold, so the observer promotes all six viewers immediately and a desktop first load is unchanged. It pays on a narrow viewport that pushes the strip down, on a filtered view that moves it, and on the rotation that used to keep running after the visitor scrolled past. **Report a fix by what you measured it doing, not by the size of the number next to it.**
**A new `<model-viewer>` on a multi-viewer page ships `data-src`, or it is eager.** There is no third option, and the attribute that looks like it should handle this does not.
diff --git a/src/marketplace.js b/src/marketplace.js
index 1f797d7c0..8b620e057 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -784,11 +784,19 @@ function renderTheme() {
//
// Each viewer ships `data-src` rather than `src`, the same contract the grid
// cards and the hero carousel already use: observeCardModelViewers() promotes
-// it on first intersect and adds `auto-rotate` there, so a strip nobody has
-// scrolled to never downloads a GLB, never stands up a WebGL context, and never
-// runs a raf loop. Shipping `src` here left this the last eager model-viewer
-// surface on the page, and model-viewer was the single most expensive script on
-// it: 7,924ms of evaluation in a Lighthouse desktop trace of /marketplace.
+// it on first intersect and adds `auto-rotate` there, and removes `auto-rotate`
+// again when the strip leaves, so an offscreen viewer holds no GLB, no WebGL
+// context and no raf loop. This was the last eager model-viewer surface on a
+// page where model-viewer is the single most expensive script in the trace
+// (7,924ms of evaluation on desktop; the strip is one contributor among the
+// grid and hero, not the whole figure).
+//
+// Be honest about when this pays. Measured in a browser at 1350x940 the strip
+// sits at y=137, so it is above the fold and the observer promotes all six
+// viewers immediately: on a desktop first load this is a no-op. What it buys is
+// the cases the old markup got wrong unconditionally, a narrow viewport that
+// pushes the strip down, a filtered view that moves it, and the raf loop that
+// used to keep running after the visitor scrolled past.
function renderThemePicks() {
const row = $('market-theme-picks');
if (!row) return;