perf: List.equals as a loop #204
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
List.equalsinstd/collections/src/list.trbisindexed().all { ... }, an iterator and a closure per item. Make it a plain loop (length check first, then compare slot by slot).Design record
PERFORMANCE.md 9.6 ("List.equals is an iterator and a closure per item"). Part of #144.
Acceptance criteria
List.equalsis a loop; behaviour is unchanged (same result for equal, unequal, different-length and empty lists), covered by a test instd/collections.sh tools/gates.sh ais green in forge CI.torb check compilerandtorb build --emit-c tests/conformance/adts.trbare not slower than onmain(alternating runs, see below).Measurement
Measured in CI, no local bootstrap: the forge CI job for the PR runs
sh tools/gates.sh a; the before/after processor times come fromtorb check tests/conformance/adts.trb,torb build --emit-c tests/conformance/adts.trbandtorb build --emit-c ./compilerrun with themainbinary and the PR binary alternating (3 runs, mean, as in PERFORMANCE.md 9.5), printed in the CI log and copied into PERFORMANCE.md 9.7. CI machines are noisy, so the ratio of alternating runs counts, not absolute seconds.Seed impact
None: no new native, syntax or looked-up name. The change alters the C of every program that compares lists (std change), which is expected and not breaking. One PR, one
perf(std):commit.[loop:torbscript] claim implement by session:loop-torbscript-20261008 until 2026-10-08T20:26Z