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

@ -67,8 +67,8 @@ function el_num(s: string) -> float {
# start, center, end, stretch; for justify also between, around, evenly - with CSS's spellings
function el_place(v: Val) -> int {
var s = vl_text(v)
if len(s) > 6 and s[0..6] == "space-" { s = s[6..len(s)] }
if len(s) > 5 and s[0..5] == "flex-" { s = s[5..len(s)] }
if len(s) > 6 and sat(s, 0, "space-") { s = s[6..len(s)] }
if len(s) > 5 and sat(s, 0, "flex-") { s = s[5..len(s)] }
if s == "center" { return UI_CENTER }
if s == "end" or s == "right" { return UI_END }
if s == "stretch" or s == "between" { return 3 }