Track under #416. The unchanged type-predicate workload has only a 1.05× Home mean lead in the complete 30-run snapshot 20260827T162037Z: Home 78.1 ± 2.3 ms versus native TypeScript/tsgo 7.0.2 at 82.3 ± 7.4 ms. Earlier snapshot 20260827T160641Z records a narrow loss (Home 71.4 ± 8.5 ms vs native TS 68.2 ± 0.4 ms), which remains documented. Preserve the accepted source hash 8b04ff5b9ae889c940facb652e5c925c7ff2aa6350058292208ca29020192350 and compiler configuration. Profile same-shape diagnostic copies only to identify general compiler work, add semantic regression coverage, run full checker and three-compiler validity gates, and publish the complete unfiltered 17-workload 30-sample comparison against TS 6.0.3 and native TS 7.0.2. Do not change corpus shape, omit samples, or use workload-specific shortcuts. Push small conventional commits linked to this issue and #416; document results in README and detailed performance docs.
perf(ts): strengthen the type-predicate benchmark margin
#455Profiled a 2,048-family same-shape copy at /tmp/home-predicate-margin.szYwis. Baseline diagnostic run: 1.23 s wall / 1.19 s user. The sampling trace shows substantial time in narrowedNamedTypeFitsDeclaredUnion → knownTypeDisplayName → objectTypeHasNamedShape, repeatedly scanning all registered names for shapes that have no match. Implementing negative shape-lookup caching keyed by TypeId and class-preference mode, guarded by a generation changed on actual type-name registration/rebinding. Original comparisons and successful lookup behavior remain unchanged; new tests cover insertion, same-count rebinding, no-op registration, source reset, and class/non-class preference separation. Corpus and compiler flags remain unchanged.
Landed automatic predicate controls in cbbf52d and generation-guarded failed-shape caching in 2de4f76. Full checker suite: 4,196/4,196 pass. ReleaseFast builds, all 17 three-compiler positive gates pass, and all nine automatic negative controls pass. Source hash unchanged. The same 2,048-family diagnostic copy falls from 1.23 s to 0.99 s and from 16.582 billion to 13.298 billion retired instructions (about 20% fewer). A short 10-sample target run was noisy: Home 78.9 ± 19.7 ms vs native TS 80.3 ± 9.8 ms, so this is not evidence of a robust margin. Follow-up sampling still shows first-time shape searches and function-declaration scans; retain those as next optimization targets. Running the complete unfiltered 30-sample suite now before publishing the updated table.
Published complete snapshot 20260827T163618Z in 401d032. All 17 workloads have lower Home means against TS 6.0.3 and native TS 7.0.2. Type predicates: Home 87.7 ± 13.5 ms vs native TS 93.4 ± 17.1 ms (1.07×). The substantial variance does not establish a robust margin; this issue remains OPEN for first-time shape searches and function-declaration scans identified in follow-up sampling. Null-safe access also has high variance (Home 65.8 ± 50.1 ms vs native TS 73.3 ± 9.6 ms); no samples were removed. Verified all 1,530 timed samples exited successfully and both README/full-doc tables exactly match raw results. Four automatic predicate controls and five destructuring controls pass in every compiler; 4,196/4,196 checker tests and ReleaseFast build pass. Source hash remains unchanged. Commits cbbf52d, 2de4f76, and 401d032 are pushed to origin/main as Chris Breuer without coauthors. Previous baseline and noisy preliminary observations remain documented.
Continuing the remaining function-declaration hotspot. The retained post-cache sample has findFunctionDeclInStatements at the top of 133/495 sampled stacks. Its four callers repeatedly search the same immutable block/namespace statement lists. Implementing a lazy per-container name index that preserves the first eligible function declaration, including export wrappers and variable-bound function/arrow initializers. Existing caller scope walks and binder precedence remain unchanged; empty/singleton lists remain direct scans. The original scanner is retained as the OOM fallback and test oracle. Regression coverage compares every candidate name across nested containers and overloads, checks source reset, and injects allocation failures before and after building the inner map.
Function-declaration indexing landed in 983c2c5; 4,198/4,198 checker tests pass, ReleaseFast builds, and all original positive/negative gates pass. Alternating preserved pre-index and new release binaries gives 72.19 ± 3.12 → 70.12 ± 3.42 ms at 256 families (30 samples, 3 warmups) and 1056.42 ± 59.81 → 850.96 ± 23.82 ms at 2048 families (5 samples, 2 warmups). A separate cross-compiler scaling probe exposes a 2.17× loss at 2048 families, so #457 now tracks that gap. The larger source is frozen as a separate workload in 932797b, without changing the existing one. Running the complete 18-workload 30-sample suite and publishing the loss rather than treating the smaller suite as universal evidence.
Function indexing is pushed in 983c2c5 with 4198/4198 tests passing and preserved scanner/OOM semantics. The full snapshot 20260827T165255Z, published in 5df5a8b, measures the unchanged small predicate workload at Home 67.6 ± 2.6 ms vs native TS 74.7 ± 6.0 ms (1.11× mean lead). Interleaved pre/post release comparisons are documented separately to avoid treating changing workstation conditions as the causal improvement. The added large workload exposes a 2.24× loss, tracked in #457 and included explicitly in README/full docs. Keeping this issue open alongside #457 for remaining general lookup costs and stronger margins.
Progress via #457: pushed 0494dc6 necessary named-shape member facts and 3c6f4e6 local declaration indexing, with 4,203 passing checker tests plus all shared positive/negative benchmark gates. Full snapshot 20260827T172600Z is published in e3bd826 and README/docs. Small predicates: Home 74.1 ± 27.2 ms vs native TS 7.0.2 91.7 ± 47.2 ms (1.24× mean lead), but variance remains substantial; keep this issue OPEN. Large unchanged predicate workload still loses by 1.57×, tracked in #457. All 30 samples retained, including noisy development results; no input or diagnostic gate changes.
Latest full snapshot 20260827T174752Z is published in 311cf8b after registered-TypeId filtering (403482530) and cache tombstone maintenance (8187216). Small predicates: Home 66.6 ± 3.8 ms versus native TS 7.0.2 82.4 ± 26.5 ms, a 1.24× mean lead. Native variance remains substantial, and isolated development comparisons did not show a small-workload improvement; those observations are retained in the detailed docs. All 4,207 checker tests and positive/negative benchmark gates pass. Issue stays OPEN while general named-shape scaling is pursued in #457; no robust-everywhere margin claim.
Latest complete snapshot 20260827T181303Z is published in a7867e5 after candidate indexing (4fccb47) and unchanged-list static builtin lookup (5a537e0). Small predicates: Home 64.8 ± 3.7 ms vs native TS 7.0.2 83.2 ± 5.9 ms, a 1.28× mean lead. Isolated builtin lookup also reduced small mean from 74.68 ± 5.84 to 69.55 ± 5.19 ms; all 30 observations retained. Full checker 4,211/4,211 plus all positive/negative benchmark gates pass. Keep OPEN: this is one local synthetic workload, broader stability is not proven, and large scaling still loses in #457.
Snapshot 20260827T183613Z at compiler commit b1fe7c9 is published in e1a9e8f and the README/full performance docs. Small predicates: Home 76.1 ± 8.6 ms, native TS 7.0.2 127.7 ± 15.2 ms, TS 6.0.3 389.0 ± 30.8 ms; 30 interleaved samples after three warmups, 1.68x lower mean against the faster competitor. Alternating preserved binaries for this optimization measured 76.87 ± 8.88 -> 72.92 ± 9.33 ms (30 each); the modest difference relative to variability is not a robust speedup claim. All samples are retained, source hashes are unchanged, and correctness controls/full 4216 checker tests pass. Keep this issue open: varying workstation conditions and the remaining large-case loss (#457) do not justify a universal/stable lead.
Addressed the original small-predicate margin without changing its accepted source or compiler configuration. Snapshot 20260827T185149Z at f18dd56, published in 6a78f4e, records Home 53.3 ± 0.8 ms versus native TS 7.0.2 74.6 ± 2.8 ms and TS 6.0.3 248.0 ± 19.6 ms: a 1.40x mean lead, materially stronger than the original 1.05x margin. All 30 samples are retained; the earlier narrow loss remains documented.
Acceptance evidence: unchanged SHA256 8b04ff5b9ae889c940facb652e5c925c7ff2aa6350058292208ca29020192350; identical shared flags; all 18 workloads (the original 17 plus large predicates), all 13 negative controls per compiler, 173 driver tests, and five harness tests pass. The unchanged 4216-test checker gate passes from cache. All 1620 samples, balanced ordering, exact versions, and both README/full-doc tables were verified. General compiler changes and semantic regressions are linked in the conventional commits.
This closure concerns only the original small-workload margin. Large predicates remain 1.18x slower and stay tracked in #457; #416 remains active for broader coverage and optimization. No claim of universal leadership.
Sign in to comment on this issue.