ludic.ui: a screen's nodes and envs are pooled and used again - two generations a screen, reset in place, their own lists emptied not replaced; a tree is good until its screen is built twice more (benchmark 256 -> 110 KB a frame)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 23:33:48 +03:00
parent 83200a453b
commit d1c9359e96
19 changed files with 307 additions and 83 deletions

View file

@ -16,10 +16,8 @@ export property UiEnv {
inst: UiInst = null # the Ludic component whose template this is
}
function env_new(parent: UiEnv) -> UiEnv {
let e = new UiEnv
e.names = new []string
e.vals = new []Val
function env_new(ui_st: mut UiState, parent: UiEnv) -> UiEnv {
let e = env_take(ui_st)
e.parent = parent
if parent != null {
e.model = parent.model