You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concrete-class member type checking now reuses RefChecks-owned Name and Symbol scratch sets instead of allocating fresh util.HashSet tables for every class. The path is hot because baseline allocation profiling showed 2.22 MiB of object arrays under RefChecks.checkMemberTypesOK, and replacing per-class table allocation with occupied-slot clearing cuts the repeated setup work visible in Arrays.fill. The scratch sets keep the same hash/equality behavior, bound retained capacity, and use a busy guard with nested fallbacks so stale entries and reentrant checkAllOverrides frames preserve the previous behavior.
Expected changes:
- Arrays.fill self% and tot% should improve: reused member-type sets clear only occupied slots instead of repeatedly allocating and clearing fresh hash-table arrays.
- MegaPhase.transformTree tot% should improve: RefChecks runs inside the broad phase traversal, so less member-type set setup should reduce the enclosing transform total.
- HashSet.isEqual self% could regress: global equality/hash-set traffic can move slightly as the old util.HashSet membership checks disappear from this path and other hash-set work becomes more visible.
- Symbol.isTerm self% could regress: the member declaration scan still tests every candidate symbol, so this unchanged predicate can move up when nearby set-management time is removed.
- No other regressions expected: equality/hash behavior matches util.HashSet, occupied slots are nulled after every class, reentrant calls get separate scratch sets, and unusually large tables are reset above the retained-capacity bound.
JFR profile deltas (5 repeats × 10 runs, mean ± stddev, iter-7/run-0 → iter-7/run-15):
1. Arrays.fill self%: 0.26 ± 0.05 → 0.16 ± 0.03 (-0.10, 2.0σ)
2. Arrays.fill tot%: 0.26 ± 0.05 → 0.17 ± 0.03 (-0.09, 1.8σ)
3. MegaPhase.transformTree tot%: 15.19 ± 0.13 → 14.07 ± 0.85 (-1.12, 1.3σ)
4. HashSet.isEqual self%: 0.19 ± 0.01 → 0.22 ± 0.02 (+0.03, 1.5σ)
5. Symbol.isTerm self%: 0.36 ± 0.04 → 0.40 ± 0.04 (+0.04, 1.0σ)
Estimated total speedup: 0.07 ± 0.06 (from rows 1 and 4 above; rows 2 and 3 are overlapping confirmation, row 5 is a scan guardrail)
Accepted. Arrays.fill self-time improves by 2.0σ and total time by 1.8σ, while the enclosing MegaPhase.transformTree total moves down. HashSet.isEqual has a small global self regression and Symbol.isTerm is at threshold, but the removed allocation path plus net direct self-time win make the scratch reuse worth carrying.
0 commit comments