Skip to content

v0.3.0

Latest

Choose a tag to compare

@TimNe0 TimNe0 released this 07 Aug 21:33

The fetch no longer freezes the app

Reported from a badge: too slow to even open the menu, though data was still arriving. The redraw work in v0.2.1 was not the cause.

The network fetch was. A TLS request plus parse takes seconds on an ESP32, and it ran on the main task — so for that whole time nothing else happened: no button handling, no redraw. Measured in the simulator as the worst gap between input polls, which is exactly how long a press can go unnoticed:

worst stall 2nd worst
Fetching inline 5.36 s 2.78 s
On a worker thread 0.28 s 0.25 s

A desktop understates it, too — mbedTLS on the badge is far slower.

The fetch now runs on a worker thread, the same pattern the published Overhead app uses on this hardware. The worker touches only a result slot and a busy flag; the main task folds the result in. Where threads are unavailable it falls back to fetching inline, and a watchdog recovers if a worker ever dies without unwinding.

Two supporting cuts

  • Parser: it re-found all four of its scan markers on every step, and str.find costs the distance it travels — so an 80 KB payload was scanned about 87 times over. Carrying the markers between steps makes each cross the text once: 87× → 3.8×.
  • Drawing: the aircraft outline is 10 points rather than 18, and glyphs are batched by colour into one path per colour instead of one draw call per aircraft. A busy frame went from 737 ctx primitives to 351. Swept edges still read as a plane at 14 px.

No change to what the app shows or how it is used.