Skip to content

#3100: the scope table is a List indexed by the symbol id - #3108

Merged
ehartford merged 1 commit into
i3100dfrom
i3100e
Nov 9, 2026
Merged

ehartford merged 1 commit into
i3100dfrom
i3100e

Conversation

@ehartford

@ehartford ehartford commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

For #3100, second step, on #3107.

scope_name_map (symbol → binding index) took 308 million lookups in one check of src/main.w and, with a binding inserted per scope entry and removed per exit, carried more tombstones than live entries (1520 live of 4056). A symbol id is a dense small integer, so the table is a SymTable: a List[i32] indexed by the id, -1 for no binding, one load per lookup and a store per pop with nothing to probe past. Same surface (contains, get, insert, remove); the lookups that read .get(sym).copied() read the value the table returns. check src/main.w clean; gate and battery after #3107's battery.

scope_name_map (symbol → binding index) took 308 million lookups in one
check of src/main.w and, with a binding inserted per scope entry and
removed per exit, carried more tombstones than live entries (1520 live of
4056). A symbol id is a dense small integer, so the table is a SymTable:
a List indexed by the id, -1 for no binding, one load per lookup and a
store per pop with nothing to probe past. Same surface (contains, get,
insert, remove); the lookups that read `.get(sym).copied()` read the value
the table returns.
@ehartford
ehartford added this pull request to stack #3109 November 9, 2026 01:06
@ehartford ehartford changed the title i3100e #3100: the scope table is a List indexed by the symbol id Nov 9, 2026
@ehartford
ehartford marked this pull request as ready for review November 9, 2026 01:27
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on 380ef53 (stack top; covers #3107 and #3108): with run tools/battery.w rc=0, wall 937 s, status green (its own gate run first). check src/main.w back to back: installed compiler (main c1a847c) 82 s, this top 70 s; the first layer alone measured 83→71 s and 86→80 s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant