Skip to content

perf(go): cache lowering metadata - #333

Merged
akonwi merged 1 commit into
mainfrom
perf.lowering
Jul 21, 2026
Merged

perf(go): cache lowering metadata#333
akonwi merged 1 commit into
mainfrom
perf.lowering

Conversation

@akonwi

@akonwi akonwi commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • precompute and cache generated Go declaration names and top-level collision sets during lowering
  • replace repeated import-alias collision scans with constant-time lookups
  • carry foreign Go result ABI shape from checker through AIR, avoiding duplicate go/packages loading in the backend
  • reject missing foreign result-shape metadata instead of silently treating it as a direct result

Performance

Warm build measurements:

Project Before After
migrate ~13.9s ~1.6s
maestro/server ~21.6s ~2.7s
tinear ~19.0s ~2.3s

Profiling showed repeated generated-name/import-collision scans dominating Go AST lowering. Rendering, workspace I/O, and final warm Go compilation were comparatively small.

Correctness

  • preserves existing type, function, global, and enum-variant naming behavior
  • updates collision planning as synthetic Maybe types are introduced
  • propagates direct, (T, error), error, and (T, bool) foreign result shapes through generic functions, methods, method values, and function values
  • keeps unknown result metadata explicit through checker and AIR so Go lowering fails clearly

Validation

  • cd compiler && go test ./... -count=1
  • cd compiler && go vet ./...
  • git diff --check
  • successful builds of Migrate, Maestro, and Tinear
  • Migrate runtime smoke test
  • randomized naming parity and generic FFI differential checks during development
  • final code review completed with the missing-result-shape finding addressed and re-reviewed

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ard-lang-dev Ready Ready Preview, Comment Jul 21, 2026 3:25pm

@akonwi
akonwi merged commit 51d4205 into main Jul 21, 2026
6 checks passed
@akonwi
akonwi deleted the perf.lowering branch July 21, 2026 15:29
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