velxio/backend/app/api/routes
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
..
__init__.py
…
compile.py perf(compile): stop three sources of per-request stall 2026-08-20 06:14:21 +02:00
compile_chip.py
…
compile_rom.py
…
flash.py
…
intellisense.py feat(intellisense): /type/ follows inheritance; extractor records bases and splits comma declarators 2026-08-17 19:08:57 +02:00
iot_gateway.py fix(gateway): keep in-browser WiFi boards reachable through the IoT gateway 2026-08-14 19:45:39 +02:00
libraries.py feat(P2.1): install index libraries by WARMING the shared cache (not the global dir) 2026-06-07 22:33:05 +02:00
micropython_libs.py feat(micropython): install libraries from the micropython-lib index (#214) 2026-08-18 21:50:10 +02:00
news.py feat(news): rich media in posts - inline images/GIFs + YouTube click-to-play previews 2026-08-05 16:25:08 +02:00
simulation.py feat(pi): techo de capacidad para los guests QEMU (multiusuario) 2026-07-29 21:15:04 +02:00