Skip to content

perf(home): demote the footer odometer, the half the beacon change missed - #184

Merged
oddharsh merged 1 commit into
mainfrom
perf/demote-odometer
Jul 31, 2026
Merged

oddharsh merged 1 commit into
mainfrom
perf/demote-odometer

Conversation

@oddharsh

Copy link
Copy Markdown
Owner

Follow-up to #175, which demoted /hit?tick=1 to priority:"low" and left /hit?n=1 at fetch's High default.

From the cold incognito HAR, 2026-07-30:

   80ms  /hit?tick=1   Low    ← #175
  153ms  /hit?n=1      High   ← this
  178ms  photo tiles   Low    (×12)

Idle fired at 153 ms on a page whose tiles start at 178 ms, so a High-priority footer odometer went out ahead of all twelve of them.

Why requestIdleCallback wasn't already covering this

It sets when the request fires, never what it outranks once it does. On a page this fast, idle arrives inside the window that decides when photos start rather than safely after it.

Why it matters on this page specifically

The tiles are deliberately fetchpriority=low — #156 measured the intro prose as the LCP element at 390px and 1280px alike, so no photo is on the critical path. That's exactly what makes a stray High request a problem: on a page that has explicitly demoted its own images, anything still defaulting to High is outranking content by accident rather than by decision.

counter.js has said it plainly since the odometer moved off the render: a footer odometer is the last thing on the page that matters.

Browsers without priority hints ignore the option and land exactly where they are today.

74 contract tests, perf budget green. Verified the hint survives minification into .build/.

🤖 Generated with Claude Code

…ssed

#175 moved /hit?tick=1 to priority:low and left /hit?n=1 at fetch's High
default. Measured on a cold incognito load, 2026-07-30: idle fired at 153ms on a
page whose photo tiles start at 178ms, so the odometer went out ahead of all
twelve of them.

requestIdleCallback was doing less work here than it looks. It sets WHEN the
request fires, never what it outranks once it does, and on a page this fast idle
arrives inside the window that decides when photos start rather than safely
after it.

The tiles are deliberately fetchpriority=low (#156 measured the intro prose as
the LCP element at 390px and 1280px alike), which is the reason this matters: on
a page that has explicitly demoted its own images, anything still defaulting to
High is outranking content by accident rather than by decision. counter.js has
said it plainly since the odometer moved off the render: a footer odometer is
the last thing on the page that matters.

Browsers without priority hints ignore the option and land exactly where they
are today.

74 contract tests, perf budget green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh dcb6ba5 Jul 31 2026, 06:04 AM

@github-actions

Copy link
Copy Markdown
Contributor

Understanding-first review

This is a prompt, not a score or merge gate. Before approving, reconstruct the change:

  • My model: What do I think this PR does?
  • Mechanism: What path or invariant makes that behavior true?
  • Falsifier: What would prove my model wrong?
  • Evidence: What test, trace, dry-run, or live check did I inspect?
  • Residual uncertainty: What remains unproven?

For docs and dependency changes, a compact answer is enough. For behavior or production changes, include the causal path and one concrete counterexample. The author’s claim card belongs in the PR description; this prompt is for the reviewer’s independent reconstruction.

See UNDERSTANDING-REVIEW.md.

@oddharsh
oddharsh merged commit 984804e into main Jul 31, 2026
4 checks passed
@oddharsh
oddharsh deleted the perf/demote-odometer branch July 31, 2026 06:14
oddharsh added a commit that referenced this pull request Jul 31, 2026
Six releases landed after the last roll (#179 through #184), and between them
they reminted nav.js, luna.css and tooltip.js. Those three were live with no
matching candidate, so anyone loading the site right now would have gone into
the next release with nothing to diff against.

Adopted 3 shell candidates and 40 page snapshots; pruned 2 and 36 by the
keep-3 / keep-2 rules. All nine shell assets carry their current hash again.

This roll also makes the PREVIOUS one measurable, which is the thing #178's
claim card listed as unprovable at the time. Its candidates are what the new
shell diffs against, and they are carrying almost the whole file:

  nav.js      vs 1df49c71    226 B  against 13341 B plain brotli   98.3% off
  luna.css    vs 76d1dbd8     75 B  against  8479 B plain brotli   99.1% off
  tooltip.js  vs 549f1cd0    351 B  against  2651 B plain brotli   86.8% off

A visitor who loaded the site during the 4f09a42 window now pays 226 bytes for
a nav.js that would otherwise cost 13 KB. That is the whole point of the
committed dictionary set, and it only becomes observable one release later.

Rolled from 984804e, which is where origin/main and origin/production both
point. `npm ci` first, then verified all six /a/ URLs referenced by the live
pages reproduce byte-exact before adopting anything — the oxc-minify version
skew that nearly poisoned #178 is still an unguarded footgun, so the check
stays manual until roll-shell-dictionary.mjs does it itself.

Gates: 74/74 contract tests, 78 routes, page contracts, perf budget.

Co-authored-by: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant