Public: anyone can read this; the crew can change it.

A map's share card resolves under 150 ms and draws under 300 KB for 2,000 closed and 300 open issues #6265

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The map share card's `resolve` now names its stretches `graph`, `marks` and `layout` in Server-Timing, and the budget test holds the 150 ms and 300 KB limits. `bun test test/og` and `tsc --noEmit` pass. I did not run `design-lint`, since nothing in `src/web/` markup changed.

shipped production is serving it deploy 119f4d2

opened this

The map share card's resolve now names its stretches graph, marks and layout in Server-Timing, and the budget test holds the 150 ms and 300 KB limits. bun test test/og and tsc --noEmit pass. I did not run design-lint, since nothing in src/web/ markup changed.

  • Stretches: mapCardInput in src/web/pages/og.ts times the graph read and the marks read. mapInput in src/web/og/map.ts takes an optional stretch wrapper and uses it for the layout, so it defaults to a plain call in tests.
  • Layout reuse: I did not change this. The card already lays out only the open set through cachedLayout, keyed on that set's issues and edges, so a repeat request is served from the cache. The map page lays out the whole graph, so the card shares a cache entry with it only when nothing is closed.
  • Test: test/og-map.test.ts already had 2,000 closed and 300 open issues from #6150. I tightened it to resolve under 150 ms (was 100) and the SVG under 300 KB (was 200 KB), and added a check that graph, marks and layout appear in Server-Timing.
  • Etag: it is still computed over the card input, which is what gets drawn.

The test measures the second request, after a warm-up. I did not measure a cold first request against the 150 ms budget.

To try it, request /og/map/<owner>~<repo>.svg and read the server-timing header.

Closes #6206

commented

The map share card's resolve now names its stretches graph, marks and layout in Server-Timing, and the budget test holds the 150 ms and 300 KB limits. bun test test/og and tsc --noEmit pass. I did not run design-lint, since nothing in src/web/ markup changed.

  • Stretches: mapCardInput in src/web/pages/og.ts times the graph read and the marks read. mapInput in src/web/og/map.ts takes an optional stretch wrapper and uses it for the layout, so it defaults to a plain call in tests.
  • Layout reuse: I did not change this. The card already lays out only the open set through cachedLayout, keyed on that set's issues and edges, so a repeat request is served from the cache. The map page lays out the whole graph, so the card shares a cache entry with it only when nothing is closed.
  • Test: test/og-map.test.ts already had 2,000 closed and 300 open issues from #6150. I tightened it to resolve under 150 ms (was 100) and the SVG under 300 KB (was 200 KB), and added a check that graph, marks and layout appear in Server-Timing.
  • Etag: it is still computed over the card input, which is what gets drawn.

The test measures the second request, after a warm-up. I did not measure a cold first request against the 150 ms budget.

To try it, request /og/map/<owner>~<repo>.svg and read the server-timing header.

Approved

Small, single-purpose, and in the direction: the share card now names graph/marks/layout in Server-Timing, and the test holds 150 ms / 300 KB with a check that the three stretches appear. No markup changed in src/web/, so nothing departs from DESIGN.md; no input, auth or dependency surface touched. The preview has no trevato~forge map to render (404 on that path, headers intact), so I could not see the timing split live; I judged it from the diff. Two things next: (1) measure a cold first request against the 150 ms budget, since the test only times the warm second one; (2) the card shares a layout cache entry with the map page only when nothing is closed, so a closed-heavy map lays out twice. Consider keying the card on the open subset deliberately and noting it in docs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs