prop/lib/microwaveprop_web
Graham McIntire af8b787915
perf(weather): binary cell-pack + canvas overlay + lazy layer prefetch
Three changes that shrink first-paint and make layer toggles instant:

1. Server: /weather/cells now supports ?format=bin and ?layers=a,b,c. The
   binary "WCEL" pack is ~3× smaller than JSON (Float32 columns, no key
   overhead) and parses with DataView + typed-array views — essentially
   memcpy on the client.

2. Client: replaced JSON parse + per-cell SVG <rect> with a custom
   Leaflet canvas layer. The pack is columnar (lats/lons + Float32Array
   per layer) and each draw is one fillRect per cell against a
   precomputed 256-step color LUT. At low zoom (CONUS, ~80k cells) SVG
   paint cost dominated; canvas keeps it under one frame.

3. Lazy prefetch: the initial fetch only requests the *current* layer
   (~1/19 the bytes). Right after paint, a single background fetch
   pulls every other layer into the same pack. Layer switches that land
   after the prefetch finishes are pure recolor — no network, no
   server CPU.

The /weather/tiles endpoint stays for backward compat. The JSON path of
/weather/cells stays too — the binary path is opt-in via ?format=bin.
2026-04-29 13:41:21 -05:00
..
components chore(layout): move deploy stamp from navbar to footer 2026-04-25 15:20:55 -05:00
controllers perf(weather): binary cell-pack + canvas overlay + lazy layer prefetch 2026-04-29 13:41:21 -05:00
live perf(weather): serve /weather from chunked scalar artifacts 2026-04-28 17:15:36 -05:00
plugs fix(remote_ip): log IPv6 in canonical hex via :inet.ntoa 2026-04-25 18:05:46 -05:00
endpoint.ex fix(web): suppress HEAD request logs 2026-04-22 16:50:58 -05:00
live_helpers.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
live_table_footer.ex Show windowed page list in live_table footer 2026-04-13 10:02:19 -05:00
live_table_resource.ex fix(dialyzer): actually fix LiveTable warnings instead of hiding them 2026-04-21 12:58:10 -05:00
location_resolver.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00
metrics_plug.ex fix(metrics): serve scrape body via PromEx.get_metrics 2026-04-18 16:50:37 -05:00
router.ex perf(weather): single-fetch viewport cells, client-side recolor on layer switch 2026-04-29 13:31:17 -05:00
skew_t.ex Rename ERA5 → NARR across the codebase 2026-04-16 09:22:23 -05:00
telemetry.ex perf(telemetry): cut hot-path overhead on scores_at cache hits 2026-04-20 16:12:01 -05:00
user_auth.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00