ludic.ui: props kept an instance, a call's arguments a depth, a loop's index shared, an absent attribute's text without a Value; runtime Value.clear - benchmark 36 -> 20 KB a frame

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 23:46:18 +03:00
parent 46888b6716
commit 51a5e06f5c
10 changed files with 43 additions and 5 deletions

View file

@ -40,3 +40,12 @@ function mm_int(ui_st: mut UiState, i: int) -> string {
}
return ui_st.mm_ints[i]
}
# a small whole number as a Value, made once and shared: read it, never change it (a loop's index)
function mm_ival(ui_st: mut UiState, i: int) -> Val {
if i < 0 or i >= 1024 { return Value.int(i) }
if ui_st.mm_ivals == null {
ui_st.mm_ivals = new []Val
for k in 0 .. 1024 { push(ui_st.mm_ivals, Value.int(k)) }
}
return ui_st.mm_ivals[i]
}