Skip to content

#3100: the two tid-keyed tables read most are Lists indexed by the type id - #3107

Merged
ehartford merged 1 commit into
mainfrom
i3100d
Nov 9, 2026
Merged

ehartford merged 1 commit into
mainfrom
i3100d

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

For #3100.

A threshold run of the map trace, joined to the addresses of every Sema map field, named the compiler's busiest tables: generic_inst_templates (214 entries, read 581 million times in one check of src/main.w) and type_decl_nodes_by_tid (645 entries, 537 million reads), more than every other map together. Both are keyed by a type id, a dense small integer, so each is now a TidTable: a List[i32] indexed by the id, one load per lookup, no hash, no probe, no contains-then-get pair. Same surface (contains, get, insert), so no use site changes; 0 means no entry, and a declaration node or a type id is never 0.

The third table, scope_name_map (308M lookups, 1520 live of 4056 entries, bindings pushed and popped per scope), stays for a second step. Gate running; battery next; the timing against the installed compiler follows the gate's release build.

…pe id

A threshold run of the map trace named the compiler's busiest tables:
generic_inst_templates, 214 entries read 581 million times in one check
of src/main.w, and type_decl_nodes_by_tid, 645 entries read 537 million
times, more than every other map together. Both are keyed by a type id, a
dense small integer, so each is now a TidTable: a List indexed by the id,
one load per lookup, no hash, no probe, no contains-then-get pair. Same
surface (contains, get, insert), so no use site changes; 0 means no entry,
and a declaration node or a type id is never 0.
@ehartford

Copy link
Copy Markdown
Contributor Author

Timing, back to back, check src/main.w, installed compiler (main c1a847c) vs this tree's release binary: 83 s → 71 s, then 86 s → 80 s. Gate green; battery running.

@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on 8d738a1 (this layer alone): with run tools/battery.w rc=0, wall 499 s, status green. The stack's top (#3108) runs its own gate and battery now; the stack merges on that verdict.

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