ludic.ui: string matching compares in place - at_alias, lk_in, colours and every s[a..b] == p made a string per position tried, per rule, per element, per frame (a benchmark page: ~3 MB -> 256 KB a frame)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 23:27:02 +03:00
parent 8808dda605
commit 83200a453b
17 changed files with 84 additions and 50 deletions

View file

@ -21,7 +21,7 @@ export function ui_forget(ui_st: mut UiState, screen: string) -> void {
let vals = new []Val
for i in 0 .. len(ui_st.st_keys) {
let k = ui_st.st_keys[i]
let mine = len(k) >= len(screen) and k[0..len(screen)] == screen and (len(k) == len(screen) or k[len(screen)] == 47)
let mine = len(k) >= len(screen) and sat(k, 0, screen) and (len(k) == len(screen) or k[len(screen)] == 47)
if not mine {
push(keys, k)
push(vals, ui_st.st_vals[i])