dkorunic/betteralign
Detect and fix struct field alignment to reduce memory usage in Go programs observed · 2026-08-28
Health v2 · maintenance only
96/100
- Activity 98
- Release rhythm 98
- Longevity 90
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 18
- age_days: 1267
- days_rel: 13
- days_push: 12
- n_releases_24m: 32
Adoption not part of the score
1078 stars · 22 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
betteralign is a Go static analysis tool that detects structs whose fields could be reordered to reduce memory usage, and can optionally rewrite them safely. It is a fork of the official fieldalignment analyzer with improvements like comment preservation, atomic writes, and safer skip/ignore controls.
Use cases
- reduce memory usage of Go structs by reordering fields
- find structs with suboptimal field alignment in a Go codebase
- automatically fix struct field ordering without losing comments
- detect positional composite literals that would break if fields are reordered
- run fieldalignment analysis in CI with opt-in or opt-out annotations
When to choose
- you want memory savings from struct field reordering in Go
- you need comment-preserving rewrites that the upstream fieldalignment tool lacks
- you have generic structs or positional literals that crash or break upstream tooling
When to avoid
- your project is not written in Go
- you only care about anonymous structs, which are deliberately skipped
- you need atomic rewrite guarantees on Windows
Facets
cli-tool · maturity active
linter formatter developer-tools developer-tools performance programming-languages go cli windows struct-alignment memory-optimization static-analysis code-rewriting golang-analyzer linux macos
1 source
- readme: https://github.com/dkorunic/betteralign · fetched 2026-08-28 · 5e0794314b32
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| dkorunic/betteralign | main | 96 |
For agents
markdown · JSON · MCP: product_card(name="dkorunic/betteralign")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem