Skip to content

#3087: WITH_TRACE_HM_PROBES=1 counts the index slots every map lookup reads - #3091

Merged
ehartford merged 1 commit into
i3083from
i3087
Nov 8, 2026
Merged

ehartford merged 1 commit into
i3083from
i3087

Conversation

@ehartford

@ehartford ehartford commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

For #3087 (the D196 follow-up): WITH_TRACE_HM_PROBES=1 counts the index slots every HashMap/HashSet lookup reads and reports at exit: total and mean, a histogram, totals by key kind, the twenty live maps that read most (key size, lookups, slots per lookup, len/entries/index-cap), and the freed maps aggregated by kind. Off, a lookup pays one global load. Documented in deep-debugging-tools.md's switch table; fixture test/behavior/behav_3087_hm_probe_trace.w.

The measurement it gave (posted on #3087): check src/main.w performs 2.6 billion lookups at 1.17 slots each, 89% in one slot, so probing is at its floor; 90% of the lookups are on 40,178 minted-keyed maps created and freed during the check. The next step there is naming the creation sites, not the hasher.

Battery runs on this PR for the whole stack (#3089, #3090, #3091).

… reads

D196 asked, after the Minted sweep, how much of a lookup is probing. The
runtime now counts, when the switch is set, the slots hm_find_slot read per
lookup and reports at exit (with_exit and the shutdown's leak report): the
total and average, a histogram, the totals by key kind, and the twenty maps
that read most with key size, lookups, slots per lookup and
len/entries/index-cap at their last lookup. A map is known by its address;
the table holds 1024 and says how many lookups fell outside it. Off, the
lookup pays one global load.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on a4151dd (stack top; covers #3089, #3090, #3091): with run tools/battery.w rc=0, wall 543 s, out/battery/status.txt green. Gate green on #3089's layer and on this top (645 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