velxio/backend
David Montero Crespo 82f25a03c4 perf(compile): stop three sources of per-request stall
Follow-ups from the compile-latency audit, all measured on staging:

- The per-target build lock keyed every board through _idf_target, which
  defaults unknown FQBNs to 'esp32' - so AVR, RP2040 and STM32 compiles
  all took the 'esp32::esp32' key and queued behind unrelated ESP32
  builds. The lock now only applies to boards that actually route to the
  ESP-IDF lane (the same startswith('esp32:') predicate _run_compile
  uses); everything else keys on its own FQBN.
- ESP-IDF re-validated its python environment on every cmake configure
  (~1s of ~9s). The image pins that env at build time, so pass
  PYTHON_DEPS_CHECKED=1 - the escape hatch idf.py uses for itself.
- _is_core_installed shelled out to 'arduino-cli core list' (~1.5s) on
  every non-AVR compile from inside an async handler, blocking the whole
  event loop rather than just that request. Memoized, and invalidated
  where a core is installed.

New hand-written code, unique source, idle box, steady state:
  ESP32-P4 ESP-IDF   28.8s -> 11.1s
  ESP32-S3 ESP-IDF   39.3s -> 11.5s
  ESP32-C3 Arduino   56.2s -> 21.0s
(the ESP-IDF numbers also carry the ldgen memoizer from the previous
commit; the queue waits the audit saw - 41s and 43s - were the audit's
own five concurrent builds and are what the lock-key fix targets)
2026-08-20 06:14:21 +02:00
..
app perf(compile): stop three sources of per-request stall 2026-08-20 06:14:21 +02:00
board-indexes
…
scripts perf(compile): memoize ldgen - 41% of every ESP-IDF build was re-parsing linker fragments 2026-08-20 05:29:56 +02:00
sdk
…
tests feat(espidf): honor CDCOnBoot menu option in 4-part FQBNs 2026-08-19 16:39:59 +02:00
.env.example
…
Dockerfile
…
debug_qemu.py
…
mcp_server.py
…
mcp_sse_server.py
…
requirements.txt fix(ci): cap mcp below 2.0 — the backend suite has not run since 2026-07-29 2026-08-10 17:14:39 +02:00