velxio/backend
David Montero Crespo f15834d14d perf(compile): memoize ldgen - 41% of every ESP-IDF build was re-parsing linker fragments
Profiled a one-file ESP-IDF compile on staging: 36.7 s total, of which
ldgen.py alone was 15.2 s - consistently, on every single build. It
re-parses all 48 component linker.lf fragments with pyparsing each time
(3.8 M _parseNoCache calls; parse_fragment_file 15.6 s under cProfile),
even though its output depends only on the sdkconfig and those
fragments, never on the user's source.

pyparsing's packrat cache was tried first and made it WORSE (15.2 s ->
27.4 s), so the fix is memoizing the whole run: a wrapper hashes the
argv plus the CONTENT of every file it references and reuses the
generated linker script when they are unchanged. Verified on staging:
15.2 s -> 0.08 s on a hit, byte-identical output, and correctly missing
when the sdkconfig or any linker.lf changes (restoring the sdkconfig
hits again - it is content-addressed, not mtime-based). Any surprise
falls through to the untouched upstream script, so a build can never
break because of the cache.

New hand-written code on the ESP32-P4 lane: 36.7 s -> 11.5 s.
2026-08-20 05:29:56 +02:00
..
app perf(compile): cache built artifacts + skip the PSRAM boot memtest 2026-08-20 05:06:20 +02:00
board-indexes fix(docker): vendor drazzy.com board index + seed missing indexes at boot 2026-07-17 06:41:44 +02:00
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 feat(chips): programmable retro CPU chips with external ROM 2026-05-18 23:38:18 -03:00
tests feat(espidf): honor CDCOnBoot menu option in 4-part FQBNs 2026-08-19 16:39:59 +02:00
.env.example chore(oss): drop dead auth/DB dependencies from OSS image 2026-05-14 17:06:27 -03:00
Dockerfile fix(docker): vendor drazzy.com board index + seed missing indexes at boot 2026-07-17 06:41:44 +02:00
debug_qemu.py feat: add documentation page and Arduino serial integration test 2026-03-12 08:17:29 -03:00
mcp_server.py feat: integrate MCP (Model Context Protocol) for agent compatibility 2026-03-11 15:29:55 +00:00
mcp_sse_server.py feat: integrate MCP (Model Context Protocol) for agent compatibility 2026-03-11 15:29:55 +00:00
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