Files
esp32-lua-api/native
evan 2104a91fc3 perf(ui): build nodes without per-node marshalling tables
build() copied a node's children into a second table so it could nil them
out of the spec, and applyStyle() copied the style keys into a third. Both
existed only to hand C a table it was already holding: tree.create reads
named fields and never touches the array part, so children come straight
off the spec, and create now applies the style itself. That is one C call
per styled node instead of two, and the sparse-style decision is made by
the set mask rather than by a loop over key names in Lua.

Measured in the emulator, 12 sensors / 131 nodes: build 106ms -> 74ms, Lua
transient +18.1kB -> +12.0kB, free heap at build end 18572 -> 27936. Tree
footprint is byte-identical, so the same styles are applied. ui.lua stripped
bytecode 10024 -> 9621 bytes, saved in every app state.

An explicit fill now wins over background, where the Lua version had
background clobber it; no caller sets both.
2026-08-08 11:31:06 -04:00
..